lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.25k stars 165 forks source link

Allow ergonomic use of `ctrl+c` for copy #486

Closed Chippiewill closed 8 months ago

Chippiewill commented 2 years ago

This commit makes two small tweaks that allow for sensible use of ctrl+C to copy:

  1. It propagates the "copy" shortcut event if there is no text selected in the terminal. This allows ctrl+c to be forwarded to the underlying TTY to interrupt the foreground process as per usual.
  2. It unselects the current selection when a clipboard copy is made. This means that after you have used ctrl+c to copy the first time it can be immediately used to interrupt the foreground process without manually unselecting.
Chippiewill commented 2 years ago

This is a tweak I've been using on my local tilda usage since November.

I've never been a fan of having to use alternative shortcuts for copy (like ctrl+shift+c), this particular change implements the setup that IntelliJ IDEs use for their terminals support out of the box which I personally find quite ergonomic which is to allow copying but not interrupting if any text is selected. The only visible change if you don't manually switch your copy shortcut to ctrl+c is it clears the selection when you copy, I think this is actually a fairly nice change anyway as it gives a visual indicator if your copy succeeded.

lanoxx commented 8 months ago

Thanks for your contribution, I have just merged it.