Repository navigation
Feat: native clipboard (using arboard) - #17572
Conversation
|
Thanks for all your work here. Is it possible to not have a new crate and put all this in the nu-cmd-base or nu-cmd-extra crate, or even another crate if there's a better fit? |
|
Yes, that should be fine. I initially kept it as a separate crate because I wanted it to be easy to remove if it turned out not to be a good fit for the shell, and also to keep its dependencies isolated. I do not have a strong preference about keeping it separate versus moving it into a other crate. If it makes more sense to place it in |
|
ya, i'd like to see it in another crate. i could live with nu-cmd-base, nu-cmd-extra, or nu-command. Not sure what else fits. |
|
Moved it to Tested so far on:
Based on prior experience, this does not guarantee correct behavior everywhere. Additional testing is needed on:
We can proceed with this change and address any platform-specific issues as they are discovered. |
c2a76e3 to
41f2097
Compare
|
I tested it on:
Seems to work great! It doesn't "just work" in all situations, but I think we can work on those edge cases as we go. What I'm wondering is if it works in all the builds that @hustcer does. |
|
Also, there is a breaking change "removal of std(-rfc)/clip" |
We could just call your commands inside the module, no? |
|
We can do that, but it raises the question of what problem it actually solves. |
|
I mean with a deprecation message. We don't need this redudancy. You could apply |
|
Understood. In that case, there are two related cleanup points:
Also, the |
|
It seems that |
|
People are going to be mad if |
Oh I thought |
|
What to do now XD
Then what to do with the |
e495626 to
da3e460
Compare
|
I'm fine with your changes just to get this PR landed. I'll try to fix the issue in another PR I guess. |
|
Thanks |
|
Thanks a lot for supporting this functionality natively! Before releasing, can we please get other people's feedback on the automatic conversion to other types? I use the plugin on which this is based and that behavior is extremely surprising so I always have to pass edit: on paste not copy |
|
I like it, it seems very nushell-y to me. Less like posix/bash. Others may feel different. |
|
Oh, I would very much appreciate an option in the configuration if it's not too much work! |
There are still some bugs related to this like #16923 |
|
It doesn't compile on android. This doesn't also seem to use the |
please move that into a new issue, we can further discuss this there |
|
I know I'm a bit late to comment on this, but i think |
|
Actually, I wanted to do that, but then I decided not to add more std changes |
|
I'm not sure that's a good idea because it now separates the |
## Release notes summary - What our users need to know ### Cross-platform clipboard command This PR integrates [nu_plugin_clipboard](https://github.com/fmotalleb/nu_plugin_clipboard) into Nushell as a built-in internal command. Migrating from an external plugin required several changes across the codebase and internal APIs. Because of this, the current implementation may not be completely stable and will likely need further testing and debugging. This PR prioritizes integration over stability, and additional fixes are expected in follow-up work. Examples: ``` # Copy data to the clipboard ~> "data" | clip copy # Pass through the copied data ~> "data" | clip copy --show | save out.txt # Retrieve data from the clipboard ~> clip paste ``` Like the original plugin, it can automatically convert objects and arrays to and from JSON. This behavior can be disabled using the `--raw` flag on the `paste` subcommand. However, to copy a raw value, you must explicitly cast it to a string. Note: this feature could be removed to keep the command simpler and aligned with a single-responsibility design, but it's a nice-to-have thing. Closes: nushell#16242 ## Tasks after merging - [ ] Update the documentation: https://github.com/nushell/nushell.github.io - [ ] Remove the legacy std/clip script --------- Co-authored-by: Motalleb Fallahnezhad <[email protected]>
|
Hi, thank you for your work on this! |
|
The nushell cargo feature But we moved the native |
|
is there anyway to copy a file, (like the reference/path of a file not the file contents), such that i can paste it into a gui application? i currently achieve this by shelling out to powershell |
|
Not at the moment. |
You could do something like this. ls | where type == file | first | get name | path expand | clip copyIs this what you mean? |
it is not, i've posted a comment in the tracking issue for this feature that explains it better. i think thats the correct place #17665 |
Cross-platform clipboard command
This PR integrates nu_plugin_clipboard into Nushell as a built-in internal command.
Migrating from an external plugin required several changes across the codebase and internal APIs. Because of this, the current implementation may not be completely stable and will likely need further testing and debugging.
This PR prioritizes integration over stability, and additional fixes are expected in follow-up work.
Examples:
Like the original plugin, it can automatically convert objects and arrays to and from JSON.
This behavior can be disabled using the
--rawflag on thepastesubcommand.However, to copy a raw value, you must explicitly cast it to a string.
Note: this feature could be removed to keep the command simpler and aligned with a single-responsibility design, but it's a nice-to-have thing.
Closes: #16242
Release notes summary - What our users need to know
Cross-platform native clipboard commands
Two new commands were added
clip copyandclip paste. They replace the implementation ofstd/clipwith a native implementation and are now built-in commands that are available all the time.Tasks after merging