2

I was using an Elementary Terminal for a long time and there was a possibility to copy and paste by ctrl+c/ctrl+v and also terminate a process. Is there some way to configure the Gnome Terminal like this?

Sevy
  • 31
  • 2
    I havenlt used the elementary terminal, but how is the terminal supposed to know when you intend to paste and when you intend to interrupt? The non-configuration answer is to train yourself to use shift+ctrl+c and shift+ctrl+v – glenn jackman Jul 09 '21 at 15:50
  • 1
    I see this caveat in the elementary terminal source code: "Shortcuts don’t require Shift; may interfere with CLI apps" – glenn jackman Jul 09 '21 at 15:57
  • How does one terminate a process in Elementary’s terminal ? – Enterprise Jul 09 '21 at 17:59
  • 1
    @PJSingh the same way as copying - ctrl+c – Sevy Jul 12 '21 at 09:02
  • 1
    @vanadium's answer is correct: if you assign ctrl+c for copying, then you wont be able to use ctrl-c for terminating processes in the terminal. – Enterprise Jul 12 '21 at 12:24
  • I hope this is helpful for you or for posterity, the answers to this question give people a full range of options for copying and pasting in the terminal: https://askubuntu.com/questions/546669/copy-and-paste-doesnt-work-in-terminal – Rabbit Jul 12 '21 at 13:54
  • This is an old thread but I'd like to add that pantheon terminal uses ctrl+c to copy only if there's text selected. Otherwise it's used for interrupt. – Elio Campitelli May 12 '22 at 17:42

2 Answers2

1

There is no way to use the same keybinding for both copying and terminating a process. The system would have no way to know what you want to achieve with the keypress.

You can assign "Edit - Copy" to Ctrl+c, but then you will need to change the corresponding terminal shortcut to something else.

vanadium
  • 88,010
1

Yes, there is a way to use the same keybinding for both copying and terminating a process, just not with Gnome Terminal (unless it has been updated since the last time I used it).

I use Tilix in GTK based desktops (e.g., Cinnamon, but it also should work in Gnome), and Konsole and Yakuake in QT based desktops (e.g., KDE Plasma). Tilix, Konsole and Yakuake all have this ability. Assign Ctrl+C to the Copy action under settings/preferences, and the these terminals are smart enough to detect whether there is a process running in the terminal. If so, Ctrl+c will terminate the process. If not, Ctrl+c will copy.