I want to remap terminal shortcuts (In particular, I want to remap INTR
from CTRL+C
to Command+C
) in Terminal.
So these are my current stty bindings
$ stty -a
speed 38400 baud; 38 rows; 179 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
-ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
stop = ^S; susp = ^Z; time = 0; werase = ^W;
And for example if you want to remap something it'd be like
stty intr \^c
Which maps SIGINT
to CTRL+C
But I want to map SIGINT
to COMMAND+C
. Something like this (which is invalid):
stty intr ⌘c
Now I know that the terminal doesn't really recognize the Command key, but is there a creative way of doing it?
Note: I know it can be done with ITerm2 but am wondering if there's a way to do it with the vanilla Terminal.
Thanks