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

show.autoclip with show.safecontent results in empy clip #3034

Open
letfadude opened this issue Jan 9, 2025 · 3 comments
Open

show.autoclip with show.safecontent results in empy clip #3034

letfadude opened this issue Jan 9, 2025 · 3 comments
Labels
bug Defects

Comments

@letfadude
Copy link

Summary

when calling gopass show -c [key] with safecontent=true results in password copied to clipboard and not showing in stdout
if configured with autoclip && safecontent and calling gopass show [key] results in empty string in clipboard and no stdout
only without setting safecontent autoclip will work correctly but password is shown in stdout

Steps To Reproduce

# with autoclip and safecontent true

$ gopass show [key]
Secret: [key]

url: [url]
username: [username]

$ xsel -b -o
\ No newline at end of selection

# with safecontent = false and autoclip = true

$ gopass show key
✔ Copied key to clipboard. Will clear in 45 seconds.
Secret: key

[secret]
url: [url]
username: [username]

$ xsel -b -o
[secret]
\ No newline at end of selection

Expected behavior

autoclip and safecontent true should result in password saved to clipboard and not displayed in stdout

Environment

  • OS: Linux Mint 21.3 (Virginia)
  • OS version: Linux fadude-tp 5.15.0-130-generic Fix git invocation #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • gopass Version: gopass 1.15.15 go1.23.3 linux amd64
  • Installation method: Debian Repo according to documentation
@dominikschulz dominikschulz added the bug Defects label Jan 9, 2025
@dominikschulz
Copy link
Member

dominikschulz commented Jan 9, 2025

I agree with the expected behavior.

@letfadude
Copy link
Author

if config.Bool(ctx, "show.safecontent") && !ctxutil.IsForce(ctx) && ctxutil.IsShowParsing(ctx) {

if check would be extended to respect not only IsAlsoClip() but also IsClip()

@letfadude
Copy link
Author

i will take a closer look at this and submit a PR asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defects
Projects
None yet
Development

No branches or pull requests

2 participants