New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the system clipboard only for explicit copy/paste operations. Addresses issue 11907 #12179
Use the system clipboard only for explicit copy/paste operations. Addresses issue 11907 #12179
Conversation
The reedline version is still patched via cargo to the github main branch at this time. I guess the dependency should be changed back to a regular reedline release before this PR gets merged? |
During development we will happily point to the main branch if we want to pull in changes from reedline. We will release a new version when necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, but we should be pretty much good to go.
Thanks again!
@@ -825,18 +825,18 @@ $env.config = { | |||
event: { edit: capitalizechar } | |||
} | |||
{ | |||
name: copy_selection | |||
name: copy_selection_system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be worth adding a comment that this requires the terminal to support the ctrl-shift bindings passing through (and the system-clipboard
feature, if it is likely to be disabled on a build).
Cargo.toml
Outdated
"which-support", | ||
"trash-support", | ||
"sqlite", | ||
"mimalloc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be reverted to the formatting we use in the rest of the tomls, also to keep the git blame
easier to read.
@Tastaturtaste Do you have time to help with the suggestions made in this PR? We'd like to get this landed asap if possible. |
@sholderbach I took a swing at tweaking this PR so we can get it in and have more testing time. Let me know if it looks good to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this looks good to me!
Hey, thanks for pushing this over the finish line. I was pretty swamped with work and other stuff the last couple of days. |
Some platforms don't support the `system-clipboard` feature, notably termux on android. The default config currently contained references to `reedline` events that are only available with the feature enabled (nushell#12179). This thus broke the out of the box config for those users. For now be more defensive about this and only enable default events. Add the alternative as commented out code you can quickly enable.
Some platforms don't support the `system-clipboard` feature, notably termux on android. The default config currently contained references to `reedline` events that are only available with the feature enabled (#12179). This thus broke the out of the box config for those users. For now be more defensive about this and only enable default events. Add the alternative as commented out code you can quickly enable. ## Tested with: ``` cargo run --no-default-features --features default-no-clipboard -- --config crates/nu-utils/src/sample_config/default_config.nu ```
Description
With the introduction of the system clipboard to nushell, many commands changed their behavior from using a local cut buffer to the system clipboard, perhaps surprisingly for many users. (See #11907)
This PR changes most of them back to using the local cut buffer and introduces three commands (
CutSelectionSystem
,CopySelectionSystem
andPasteSystem
) to explicitly use the system clipboard.User-Facing Changes
Users who in the meantime already used the system clipboard now default back to the local clipboard. To be able to use the system clipboard again they have to append the suffix
system
to their current edit command specified in their keybindings.Tests + Formatting
The commands themselves are tested in
reedline
. The changes introduces in nushell are minimal and simply forward from a match on the keybinding name to the command.After Submitting