Sunday, May 5, 2024
95
rated 0 times [  95] [ 0]  / answers: 1 / hits: 79615  / 2 Years ago, wed, november 24, 2021, 11:50:17

Is it possible for me to make Ctrl+C perform a copy command if there is highlighted text in the terminal?

Otherwise, it should retain its normal behavior.



(If there is a terminal that can do this other than gnome-terminal, that's probably fine too.)


More From » gnome-terminal

 Answers
3

You can change the keybinding for Cut and Paste from the default Ctrl+Shift+C, Ctrl+Shift+V to what you say, namely Ctrl+C, Ctrl+V, in the Edit → Keyboard Shortcuts menu. Though you should also change the default terminal meaning associated with Ctrl+C (interrupt), for example in this way



stty intr ^J


(I chose Ctrl+J because I don't remember it is associate with some action, but you can make your own choice.)



I don't think it is possible to retain the default interrupt action for Ctrl+C only when there is no text highlighted.


[#44182] Friday, November 26, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
taigysel

Total Points: 33
Total Questions: 136
Total Answers: 114

Location: Singapore
Member since Wed, Jan 13, 2021
3 Years ago
taigysel questions
;