Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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!

share|improve this question
1  
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 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 1 '12 at 17:20
add comment

closed as not constructive by Gilles, Renan, jasonwryan, Mat, manatwork Dec 3 '12 at 7:31

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
Thank you. Ctrl-Z was my first inclination, but I do sometimes suspend VIM when a simple :! is too little but a new window is too much. –  dotancohen Dec 2 '12 at 23:00
1  
That's when I would use :shell. –  Arcege Dec 3 '12 at 12:47
    
Thank you, :shell is perfect! –  dotancohen Dec 3 '12 at 15:04
add comment

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.

share|improve this answer
    
Thanks. However VIM uses that shortcut with ctags to jump to the definition of a function. –  dotancohen Dec 1 '12 at 17:18
add comment

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.

share|improve this answer
    
Normally, I've used <kbd>Ctrl</kbd><kbd>J</kbd> 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 2 '12 at 2:34
    
Thanks for the tip, Arcege! I was unaware of that particular use case. –  dotancohen Dec 2 '12 at 22:59
add comment

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