Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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:

escape ^\\\

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 for C-a or C-x C-a or C-c C-a. If you choose C-\, it's normally bound to toggle-input-method, which is useful if you write in multiple languages and useless otherwise. You can rebind it to a different key with global-set-key in your ~/.emacs:

;; overrides a binding for `suspend-frame', which is also bound on `C-x C-z'
(global-set-key "\C-z" toggle-input-method)
share|improve this answer
Thanks. I used the key binding proposed by @cjm – Yotam May 2 '11 at 9:17

Create ~/.screenrc containing:

escape ^Zz

Then use Ctrl-Z instead of Ctrl-A to control screen.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.