Recently I've been reviewing the bash shortcuts keys, and trying to find an appropriate one for my tmux activate key.I find it interesting that ctrl + m and ctrl + q are not used in bash shortcuts, according to https://en.wikipedia.org/wiki/Bash_(Unix_shell).Why they are not used? I feel ctrl + m is quite handy.Are these two combinations intended by design for DIY (define it yourself) usage? Or there is another story?
Why aren't Ctrl+m and Ctrl+q used in bash shortcuts?
bash;keyboard shortcuts
Ctrl+M sends the same character(RET) as the Enter key in terminal. Programs have no way to tell them apart, so these keys cannot be configured separately.Ctrl+Q is already used for XON by default, so it cannot be used by Bash, but you should still be able to use it in tmux, because tmux uses raw input mode.A GUI program could read from the keyboard, that Key m has been pressed with modifier Ctrl and use Ctrl+m as a shortcut, but a shell or any terminal program recieves the Ctrl+Key combinations just as ascii characters from 0 to 26Ctrl+@ = 0Ctrl+A = 1Ctrl+B = 2and so on. You can try this to see the valuescat ctrlkeys <<EOF^A^B^C^D^E^FEOFod -c ctrlkeys0000000 001 002 003 004 005 006  \nTo enter the values press Ctrl+v before Ctrl+[a-f] to get them uninterpreted as a raw value.When you look at the ascii(7) table you can see the control codes in a table with the corresponding characters @..Z on the left. For example015   13    0D    CR  '\r' (carriage ret)     115   77    4D    Mor 011   9     09    HT  '\t' (horizontal tab)   111   73    49    IThe next layer that interprets control codes before bash is stty (change and print the terminal settings)stty -aintr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;see stty(1) for the meanings of lnext or start and stop.Also see readline(3) as bash and other GNU cli programs use that library to control input lines and of course bash(1) /READLINE, the readline section of the bash manual page.Note: XYZ(NUM) means manual page XYZ from section NUM, so the result of man NUM XYZ.