Fix: CLI: cleanup clipboard on CTRL+C #13549 - #13552
Open
DRIP-70 wants to merge 2 commits into
Open
Conversation
Author
|
It seems I don't know how to use comments, please use the Files changed tab for understanding those. |
Member
|
Did you test this? I am not clear how this code is any different then before. This would be the desired implementation |
droidmonkey
requested changes
Jul 28, 2026
Author
Yes, I have tested this, the video attached actually shows that. |
Member
|
The code doesnt change any code paths, your use of the global variable appears to be totally unnecessary. I think the fact that you are overriding the handler of the terminal signals is enough. You are basically ignoring them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13549
At the moment, when keepassxc-cli clip is interrupted using Ctrl+C (SIGINT) or SIGTERM before the countdown timeout expires, the OS ends the process immediately, leaving the password available on the clipboard.
This PR adds signal handling to Clip::executeWithDatabase():
Generative AI was used to refine the code.
Screenshots
Posting video since clipboard is used and it is difficult to screenshot
Video.Fix.mp4
Testing strategy
Manually tested on Fedora Linux:
Type of change