Clipboard icon indicating copy to clipboard operation
Clipboard copied to clipboard

Purge history to prevent secret leakage

Open luanpotter opened this issue 1 year ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe.

Sorry if I am just being dumb, I took a look at GitHub and at the man-pages for this, and I could not find any relevant threads to poke at.

Currently, I could not find a simple way to purge the entire clipboard history, across all clipboards. I can use cb clear to clear the current value, but the history remains set in stone.

Describe the solution you'd like

I would propose to add a cb purge [x] command, where if x is not specified, purges all entries in the history, and if it is, purge the last x entries. Purge would completely obliterate any references to the value and remove it from history. Of course, the command would ask for a confirmation before doing an irreversible operation.

Describe alternatives you've considered

I eventually found out data is stored under /run/user/x/Clipboard, so I was able to "purge" by deleting it. But that is not very intuitive nor have I found it document anywhere, and it also lacks easy fine controls of what to purge.

Additional context

This is particularly useful if you end up copying say a password or secret by mistake, that you then want to purge from the system.

Again, I am so sorry if I am missing anything from the doc or that should be obivous.

luanpotter avatar May 14 '24 02:05 luanpotter

This sounds like a fine feature, and it almost seems like it might be doable since the current entry selection system could easily include a range instead of a single entry.

Slackadays avatar Jul 31 '24 20:07 Slackadays

I just reread your comment and what you're asking for already exists: cb clear -a. This clears everything across all clipboards, but it can only do that. I will still consider adding a range feature because this would help other actions too, so stay tuned for that.

Slackadays avatar Oct 06 '24 00:10 Slackadays

@luanpotter added in https://github.com/Slackadays/Clipboard/commit/6cbf9e063ea70fda5e796870f7d28f451a750b26

Slackadays avatar Oct 23 '24 19:10 Slackadays

Awesome! Thank you so much! 🙇

luanpotter avatar Oct 24 '24 22:10 luanpotter