Skip to content

[BUGFIX] Fixed password not saving to clipboard with safecontent and autoclip true #3053

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

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

letfadude
Copy link
Contributor

Fixed an issue where enabling both AutoClip and SafeContent prevented passwords from being saved to the clipboard. Added tests to cover this case.

Signed-off-by: Alex Wallner wallneralex7789@gmail.cpm

…ontent are both enabled

Fixed an issue where enabling both AutoClip and SafeContent prevented passwords from being saved to the clipboard.
Added tests to cover this case.

Signed-off-by: alex <wallneralex7789@gmail.com>
@letfadude
Copy link
Contributor Author

fixes #3034

AnomalRoil
AnomalRoil previously approved these changes Feb 24, 2025
Copy link
Member

@AnomalRoil AnomalRoil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding a test

Comment on lines 274 to 278
if config.Bool(ctx, "show.safecontent") && !ctxutil.IsForce(ctx) && ctxutil.IsShowParsing(ctx) {
body := showSafeContent(sec)
if IsAlsoClip(ctx) {
if IsAlsoClip(ctx) || config.Bool(ctx, "show.autoclip"){
return pw, body, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this won't display the warning "⚠ show.safecontent=true. Use -f to display password, if any" and instead will just display "✔ Copied to clipboard. Will clear in 45 seconds.", right?

But I guess that should be fine, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes exactly!
just shows the ✔ Copied line
I think it might be a little more intuitive

@AnomalRoil AnomalRoil linked an issue Feb 24, 2025 that may be closed by this pull request
gofmt -> should now pass golangci-lint

Signed-off-by: alex <wallneralex7789@gmail.com>
Copy link
Member

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test. Makes this much nicer to review.

@dominikschulz dominikschulz merged commit 98deb46 into gopasspw:master Feb 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show.autoclip with show.safecontent results in empy clip
3 participants