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?

link|improve this question
belongs on superuser.com - voting to close – t0mm13b Sep 17 '10 at 13:36
@tommie: You are voting to migrate which is an important difference to explain to new comers. @Sibshops: That means that if a quorum is reached the question will be automatically moved to the more appropriate site, and that you should not re-post there to prevent inadvertent duplicates. Oh, and I agree that this would be better on Super User and have voted for it. – dmckee Sep 18 '10 at 22:12
feedback

migrated from stackoverflow.com Sep 19 '10 at 0:20

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

2 Answers

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

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

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown