On my Macbook, I use CMD+c = SIGINT and ctrl+c = copy (as in copy/paste). On my Ubuntu machine, ctrl+c = SIGINT and ctrl+c = copy depending on the context and that's awful, because it's the same keystroke.
Does anyone know of a good way to map keys on Ubuntu so that ctrl+c = copy and maybe windows key + c = SIGINT?
Furthermore, in the Ubuntu terminal window, to copy/paste I have to use ctrl+shift+c /p which is annoying - I would rather just use ctrl+c / ctrl+p, and to issue a SIGINT, use a different keystroke.
note: the windows key is also known as the superkey: https://en.wikipedia.org/wiki/Windows_key
You can remap the "Copy" function in the terminal emulator to Ctrl+c in "Preferences" - "Shortcuts". That will override the tty terminal shortcut.
Options to change the tty terminal shortcuts are more limited. These shortcuts stem from older times, and only Ctrl+letter combinations may be supported. You can change the assignment of these keys with the
stty
.To see all assignments, use the command
To change the Ctrl+C assignment which by default is to "intr", use the command
Here, intr was remapped to Ctrl+X.
To automatically remap that key as soon as you start the terminal, add the command to your
.bashrc
file.Will that be helpful: https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html.en? The article is for 19.10 but it is the same from 18.04 at least. You can modify existing mappings and create your custome writing a command you want.