Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnu screen - changing the default escape command key to ALT-X?

In GNU screen, I want to change the default command binding to Alt-s (by tweaking .screenrc) instead of the default C-a, the reason is I use emacs hence GNU screen binds the C-a key, sending "C-a" to the emacs becomes tedious (as @Nils said, to send "C-a" I should type "C-a a"), as well as "C-a" in bash shell, and I could change the escape to C- but some of them are already mapped in emacs and other combinations are not as easy as ALT-s . If anyone has already done a ALT key mapping, please do let me know.

like image 618
Siva Avatar asked Oct 09 '09 12:10

Siva


1 Answers

It is possible to work around :escape command limitations using registers and :bindkey command. Just put this in .screenrc:

# reset escape key to the default escape ^Aa  # auxiliary register register S ^A  # Alt + x produces ^A and acts as an escape key bindkey "^[x" process S  ## Alt + space produces ^A and acts as an escape key # bindkey "^[ " process S 

See http://adb.cba.pl/gnu-screen-tips-page-my.html#howto-alt-key-as-escape

like image 109
askonecki Avatar answered Sep 21 '22 09:09

askonecki