I'm working with emacs (on the terminal) and I use screen to switch between terminals. The key combination Ctrl+A is grabbed by screen. Is there a way to change screen key binding?
Working with screen and emacs
emacsgnu-screenkeyboard shortcuts
emacsgnu-screenkeyboard shortcuts
I'm working with emacs (on the terminal) and I use screen to switch between terminals. The key combination Ctrl+A is grabbed by screen. Is there a way to change screen key binding?
Best Answer
Sure, you can change the binding in either Screen or Emacs.
I use Ctrl+\ in Screen, which is used by very few applications. It's used in the terminal to send the QUIT signal — a stronger version of Ctrl+C, which fewer applications catch and may produce a core dump. That's rarely useful, and if you need it you can press Ctrl+\ \. A bigger argument against Ctrl+\ is that it's hard to type on some keyboard layouts. Anyway, pick the key you prefer.
To change the Screen escape key, use the
escape
directive in~/.screenrc
:In Emacs,
C-a
normally moves to the beginning of the line; you can use Home instead.C-x C-a
is not bound. That leaves modes with custom bindings forC-a
orC-x C-a
orC-c C-a
. If you chooseC-\
, it's normally bound totoggle-input-method
, which is useful if you write in multiple languages and useless otherwise. You can rebind it to a different key withglobal-set-key
in your~/.emacs
: