Super User is a question and answer site for computer enthusiasts and power users. 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 keep accidentally switching the audio bell to the visual bell by turning on by hitting C-a C-g.

In emacs C-g is used stop or abort the current command or process. If I already hit a C-a and then decide I want to abort everything, I start spamming C-g.

Unfortunately, this toggles the bell style between audio and visual.

I would like C-a C-g to abort the current command or process in screen, so that when I hit C-g I abort all processes and commands in both screen and emacs.

What would I need to add to change this key binding?

share|improve this question

migrated from Sep 19 '10 at 0:20

This question came from our site for professional and enthusiast programmers.

To answer the question in the title, read the docs, and add this to your .screenrc:

bind ^g
share|improve this answer
Oh, that also does what is in the text, too. Thanks. – Sibshops Sep 17 '10 at 15:57

If you use both screen and emacs regularly, you can save yourself a lot of aggravation by changing the screen escape character. For example, add something like this to your .screenrc:

escape ^Zz

This changes the prefix for all screen keystrokes from C-a to C-z. C-z is a good choice for two reasons. First, it's not mapped to anything I regularly use in emacs. But it also works for me since C-z C-d detachs from a screen session, which is one of the more common things I do in screen sessions, and I associate it with suspending a process with C-z.

share|improve this answer
For future noobs: be careful what you bind here; keys like 'ctrl-g' conflict with other sequences. – New Alexandria Jul 5 '13 at 19:34

You must log in to answer this question.