Do not copy empty selection
As it currently stands, copying from the terminal using the ctrl+shift+c
keyboard shortcut (might occur with the right-click menu as well, but I can't test right now) copies the empty selection (no text) to the clipboard and essentially clears the clipboard. This is very annoying and means that a simple miss-click with ctrl+shift+c
, instead of ctrl+shift+v
, results in having to go back and re-copy the contents.
I suggest that you add a check to see if any text is selected, and if it is not, it should not copy anything to the clipboard.
Reproduced on Gnome Terminal 3.40.1 on Solus (latest rolling release with Gnome 40) and on Fedora 34.
Edited by Ghost User