4

Screen uses the shortcut CtrlA to activate. I find that this interferes with the Bash command for jumping to the start of the line, and the VIM command for incrementing an integer. Certainly I could just remap it, but I am interested to know how other screen users deal with the situation. I don't think that I use CtrlQ for anything. What drawbacks and gotchas have other screen users encountered when changing the default shortcut?

Note that I was unsure if Unix.SE or SuperUser would be more appropriate a place to post this. This could be a "chatty, open-ended question" or it could be a very useful resource for other screen users who undoubtedly encounter this, depending on how disciplined the answers are. I suspect that other screen users will more likely stumble across the question on Unix.SE. If SuperUser is a more appropriate place then any mod is welcomed to move it. Thanks!

dotancohen
  • 15,864
  • 2
    Hitting C-a a will send C-a to the terminal – jordanm Nov 30 '12 at 15:17
  • Different strokes for different folks. This is a poll question, and those don't do well on Stack Exchange. For the poll: I use C-\, which few applications use. – Gilles 'SO- stop being evil' Nov 30 '12 at 21:09
  • Thanks Jordanm, I happen to know that. But I find that extra keystroke breaks all continuity, so instead of the fingers just doing the thinking the brain must get involved. Maybe I'm just a VIM-spoiled brat! – dotancohen Nov 30 '12 at 21:53
  • 1
    Then you should be using vi-mode in your shell, surely? :) – jasonwryan Nov 30 '12 at 23:36
  • @jasonwryan: Actually, I hated VI-mode in the shell. For single-lines of text I find the default Bash / Emacs shortcuts preferable, especially as the only one that I really need is to jump to the beginning of a line or such (other than history). – dotancohen Dec 01 '12 at 17:20

3 Answers3

1

Ran into this years ago, and decided I would permanently bless Ctrl] to be screen's shortcut key. In your .screenrc:

escape "^]]"

Then you still have Ctrl-A for all begninning of line goodies in Emacs, GNU readline, etc.

ckhan
  • 4,132
1

Using CtrlQ is probably not a good idea unless you remap the start terminal key, for example, to CtrlX:

stty start '^X'

This is the complement of the stop character (CtrlS), which suspends output to the terminal from the OS.

Myself, I've been using CtrlZ for over twenty years. I don't often suspend things since I can just create a new window, but if I do need to, then I just hit it twice.

Arcege
  • 22,536
0

I found the best solution to be to remap the screen activation shortcut to CtrlJ. This has the advantage of only one hand leaving home row, and that hand does not have to do any contortions to press any other keys. The VIM mapping of CtrlJ merely inserts a linefeed (useless, I didn't even know about it) and the Bash mapping of CtrlJ presents the text of a search for editing (again, a mapping I didn't even know about and has a sensible workaround).

I hope that other screen users find this helpful.

dotancohen
  • 15,864
  • Normally, I've used CtrlJ after some curses program has crashed, since I need some way to reset the terminal to accept commands again (carriage returns won't work). I'd type in stty sane<kbd>Ctrl</kbd><kbd>J</kbd>. Don't think I'd give this up for 'leaving home row'. – Arcege Dec 02 '12 at 02:34
  • Thanks for the tip, Arcege! I was unaware of that particular use case. – dotancohen Dec 02 '12 at 22:59