Skip to content
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

gopass show can't copy to clipboard from WSL #1664

Open
slokhorst opened this issue Dec 11, 2020 · 9 comments
Open

gopass show can't copy to clipboard from WSL #1664

slokhorst opened this issue Dec 11, 2020 · 9 comments
Labels
windows Affects Windows (only)
Milestone

Comments

@slokhorst
Copy link
Contributor

slokhorst commented Dec 11, 2020

I'm using gopass in an WSL 2 instance (Windows Subsystem for Linux). This works great with one exception: every time I run gopass generate test it says:

Error: failed to copy to clipboard: failed to write to clipboard: exit status 1

I found that it is possible to copy text to the clipboard with echo 'test' | clip.exe (src), but I'd understand if this is too niche to implement in gopass.

As an alternative, maybe would be a sane default to just print the generated password if copying to the clipboard fails?

Windows 10 20H2 with WSL2
Ubuntu 20.04.1
gopass 1.9.0

@AnomalRoil
Copy link
Member

AnomalRoil commented Dec 11, 2020 via email

@slokhorst
Copy link
Contributor Author

Yes, I already have xclip installed. Still doesn't work unfortunately.

@dominikschulz dominikschulz added the windows Affects Windows (only) label Dec 12, 2020
@dominikschulz dominikschulz added this to the 1.x.x milestone Dec 12, 2020
@AnomalRoil
Copy link
Member

The easiest way for us is to wait until support for WSL is added to atotto/clipboard ^

@dominikschulz
Copy link
Member

Yes, I think we need to wait for atotto/clipboard#45 to be resolved.

@Hazegard
Copy link
Contributor

Hi!

As a workaround I have this little script called xclip in my PATH:

#!/bin/bash
cat | clip.exe

It works enough to have passwords and otp codes in my windows clipboard.

@AnomalRoil
Copy link
Member

That's a nice workaround, indeed. 😄

@slokhorst
Copy link
Contributor Author

@Hazegard that works great, thanks!

@AnomalRoil
Copy link
Member

We might consider switching to https://github.com/golang-design/clipboard which is reported to work with WSL on windows.

@dominikschulz
Copy link
Member

No, that's using CGo. We can not introduce CGo dependencies with our current build system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Affects Windows (only)
Projects
None yet
Development

No branches or pull requests

4 participants