Open zupd opened 9 months ago
Hello, Thanks for reporting this, I'm surprised because we don't use "clipboardy" package but an implementation in Rust that should work with wayland. Can you confirm you're running the latest version of the CLI please?
Hello, Just a reminder on this issue, if I get no answer this week I'll close it but you can feel free to comment anytime to reopen it of course. Thanks a lot!
Sorry, I'll check this today
@Mikescops Sorry for not responding in a while. When I tested this in february I was running version 1.15.0. Today I updated the client to 6.2424.2 and I can confirm the clipboard functionality is working as intended yes.
@zupd awesome thanks!
This issue is still present on current version.
This issue is still present on current version.
I can confirm this @Mikescops . It seems that when I tested this first, it was on Ubuntu 23.04, and when I tested it the second time I was on Debian 12 which also uses wayland. And I assumed it worked in the latest version now, since it worked on Debian 12, but when I now tried it on my Ubuntu again it won't copy to my clipboard. This is on the latest version of dcli.
~/Downloads$ wl-copy 'TEST123'
~/Downloads$ wl-paste
TEST123
~/Downloads$ dcli p github
🔓 password for "GitHub" copied to clipboard!
~/Downloads$ wl-paste
No selection
It almost seems like dcli resets the clipboard and doesnt copy anything into it
I will test a theory in the morning but it seems that the clipboard package being used will do an ANSI OSC52 sequence to copy if it detects it is being run from within ssh, which should work fine with sway.
If anyone desires to test this, my working theory is that if you are running ssh inside of sway this would work fine. I'm not at my sway desktop currently but will examine further.
Okay after further examination here are some notes. Your package uses napi-rs/clipboard which, under normal circumstances, uses arboard clipboard, which itself has a flag that can be used during compilation of wayland-data-control
. I imagine this could aid in solving such problems since this uses wl-copy
as a secondary copying method.
As they note
There's also an optional wayland data control backend through the wl-clipboard-rs crate. This can be enabled
using the wayland-data-control feature. When enabled this will be prioritized over the X11 backend, but if the
initialization fails, the implementation falls back to using the X11 protocol automatically. Note that in my tests the
wayland backend did not keep the clipboard contents after the process exited.
EDIT: I am wrong, further examination shows napi-rs/clipboard compiles arboard with wayland-data-control
. A real head scrathcher. I will test each dependency when I am back at my main computer. Too many dependencies deep...
Okay quick update. This problem goes all the way down to arboard. Arboard can successfully retrieve clipboard data in sway but cannot copy to the clipboard even with the wayland-data-control
feature...
$ ./target/debug/copy
Clipboard text was: test
But now the clipboard text should be: "Hello, world!"
$ wl-paste
Nothing is copied
Okay quick update. This problem goes all the way down to arboard. Arboard can successfully retrieve clipboard data in sway but cannot copy to the clipboard even with the
wayland-data-control
feature...$ ./target/debug/copy Clipboard text was: test But now the clipboard text should be: "Hello, world!" $ wl-paste Nothing is copied
This looks just like my test with dashlane when I had something in the clipboard, then ran dashlane and then clipboard was empty
Hey guys, thanks for your nice investigation.
As arboard author mentioned Note that in my tests the wayland backend did not keep the clipboard contents after the process exited.
which seems to match the behaviour we have here, you copy something, the process exit, and the content disappear from clipboard.
I think it will be hard to support every environments with the clipboard functionality, do you think it's acceptable to output the password directly so it can be piped into wl-copy? If so we can just suggest such command in our documentation.
Hey guys, thanks for your nice investigation.
As arboard author mentioned
Note that in my tests the wayland backend did not keep the clipboard contents after the process exited.
which seems to match the behaviour we have here, you copy something, the process exit, and the content disappear from clipboard.I think it will be hard to support every environments with the clipboard functionality, do you think it's acceptable to output the password directly so it can be piped into wl-copy? If so we can just suggest such command in our documentation.
It already supports that, right? if you use -o console
. though I noticed that it also includes the "password for .. copied to clipboard". Seems strange that it says that when you use console as output instead of clipboard
@zupd definitely a bug, I'll take a look thanks
Describe the bug When using Wayland / Sway passwords wont get copied to the clipboard.
To Reproduce Steps to reproduce the behavior:
Expected behavior Password should get copied to clipboard
Screenshots
Environment (please complete the following information):
Additional context The reason why this happens is because wayland dont use xsel / xcopy to copy to clipboard. it uses wl-copy instead. And there is currently no support for this in the clipboardy package that dashlane CLI uses.