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

Always copy passwords to clipboard #1255

Closed
MartinAltmayer opened this issue Mar 19, 2020 · 8 comments · Fixed by #1316
Closed

Always copy passwords to clipboard #1255

MartinAltmayer opened this issue Mar 19, 2020 · 8 comments · Fixed by #1316
Labels
ux User experience / User Interface related
Milestone

Comments

@MartinAltmayer
Copy link

Summary

It would be great if I could configure gopass to always copy passwords to the clipboard, without using -c. I almost never need to actually see a password and would prefer to simply use -f in those cases.

Wouldn't it make sense to always copy the password if the option autoclip is set to true?

In my opinion this would also be a much cleaner behaviour of autoclip than the current behaviour:
According to the docs autoclip only applies to generate, not to show (but see #1191). But since #685 it also applies to show under some circumstances (namely if safecontent is set to true and the password does not have safe content).

Steps To Reproduce

Set autoclip to true
Run gopass some/password
The password will be printed.

Expected behavior

The password should be copied instead.

Environment

  • OS: Arch Linux
  • gopass Version: gopass 1.8.6 (2020-02-29 13:42:01) go1.14 linux amd64
  • Installation method: Arch Linux Repos
@martinhoefling
Copy link
Contributor

I have autoclip turned on but often use show without -c to actually show the whole entry. But I agree, the setting(s) could be a bit disentangled and enhanced. Any suggestions how to structure functionality and config here?

@dominikschulz dominikschulz added the ux User experience / User Interface related label Apr 24, 2020
@dominikschulz dominikschulz modified the milestones: 1.x.x, 1.9.0 Apr 24, 2020
@MartinAltmayer
Copy link
Author

Maybe one could add another option alwaysclip. Then the user could choose between

  • default behaviour: never copy to clipboard unless using '-c'
  • alwaysclip: always copy to clipboard unless using '-f'
  • autoclip: current mixture of both.
    (I would prefer to change the behaviour of the existing autoclip option, but I guess backwards compatibility forbids this.)

"copy to clipboard" refers to the whole password if safecontent is false, or only the first line if safecontent is true.

@dominikschulz
Copy link
Member

We have way to many configuration options already. I definitely don't want to increase that number.

Changing autoclip to also cover show and other subcommands sounds good to me.

@dominikschulz dominikschulz modified the milestones: 1.9.0, 1.x.x May 1, 2020
@dominikschulz
Copy link
Member

What about using autoclip to always suppress printing passwords and copying to the clipboard instead.

So far this would apply to show and generate, in the future possible to other operations, too.

I'd default to having autoclip false. Personally I don't like programs messing around with my clipboard and prefer to print it to the screen. Since my credentials are almost always autogenerated, long, cryptic and unique to a service I don't mind passers by so much.

@dominikschulz dominikschulz modified the milestones: 1.x.x, 1.9.1 May 2, 2020
@martinhoefling
Copy link
Contributor

Sounds good to me. Apart from the default, that's the initial suggestion from @MartinAltmayer but that can be configured to match personal preferences.

dominikschulz added a commit to dominikschulz/gopass that referenced this issue May 2, 2020
@MartinAltmayer
Copy link
Author

MartinAltmayer commented May 3, 2020

Thanks for implementing a fix!

Here are some behaviours that look incorrect to me (unless otherwise specified I assume autoclip and safecontent to be false):

  • gopass show -c temp/test will not copy the secret to clipboard (see gopass show --clip not copying to clipboard #1317).
  • gopass show -c --alsoclip temp/test will copy all lines of the secret, contradicting the description of alsoclip in gopass help show.
  • With autoclip set to true, gopass show temp/test will copy the first line and display nothing. I could not find a way to view/copy the other lines (with --force, it will copy and display the first line).

To reduce the number of different cases, I believe it would be simpler to have "autoclip" be equivalent to --clip, similar to this line:

ctx = WithClip(ctx, c.Bool("clip") || c.Bool("alsoclip") || ctxutil.IsAutoClip(ctx))

@MartinAltmayer
Copy link
Author

Let me know if I can help in fixing this!

dominikschulz added a commit to dominikschulz/gopass that referenced this issue May 3, 2020
dominikschulz added a commit to dominikschulz/gopass that referenced this issue May 3, 2020
Fixes gopasspw#1255
Fixes gopasspw#1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <[email protected]>
dominikschulz added a commit to dominikschulz/gopass that referenced this issue May 3, 2020
Fixes gopasspw#1255
Fixes gopasspw#1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <[email protected]>
dominikschulz added a commit to dominikschulz/gopass that referenced this issue May 3, 2020
Fixes gopasspw#1255
Fixes gopasspw#1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <[email protected]>
dominikschulz added a commit to dominikschulz/gopass that referenced this issue May 3, 2020
Fixes gopasspw#1255
Fixes gopasspw#1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <[email protected]>
dominikschulz added a commit that referenced this issue May 3, 2020
Fixes #1255
Fixes #1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <[email protected]>
@MartinAltmayer
Copy link
Author

Thanks for implementing this! I think I tried all combinations of autoclip, safecontent, -c, -C, -f and couldn't find any issues.

kpitt pushed a commit to kpitt/gopass that referenced this issue Jul 21, 2022
Fixes gopasspw#1255
Fixes gopasspw#1317

RELEASE_NOTES=[BUGFIX] Simplify autoclip behavior

Signed-off-by: Dominik Schulz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User experience / User Interface related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants