0

I can split my screen window horizontally by typing Ctrl-A S (or vertically with Ctrl+A |), and then I can switch between windows with Ctrl-A Tab. I'd like to also be able to switch windows with Ctrl-A o (to parallel how you can switch windows in emacs with Ctrl-x o). I've tried reading the docs on screen's bindkey command, but I find them completely inscrutable. Can anyone help me make this change? Thank you!

Note: I'm not actually using Ctrl-A as my escape key, I've actually set my escape key to backtick, but backticks wreak havok on the formatting on stackchange, so I left the examples using the default Ctrl-A escape sequence to make this question easier to type out. I'm assuming the solution shouldn't care about what the escape sequence actually is, so long as I can set the key sequence to change windows to be <escape sequence> o

1

See the docs.

Add this to your .screenrc file:

bind o focus next
5
  • Interesting, I had been looking at the docs for 'bindkey' not for 'bind', which now raises the question on what the difference is... Anyway this suggestion doesn't do exactly what I want. This gives Ctrl-A o the same behavior as Ctrl-A n, but I want it to have the same behavior as Ctrl-A Tab. I'm not sure exactly what actual correct terminology for screen is, but this is cycling through what I think of in my head as the 'tabs', but not the 'windows'. – stbrody Oct 31 '20 at 14:57
  • Looks like maybe the proper terminology is that the 'next' command goes to the next "window" but what I want is the next "region" – stbrody Oct 31 '20 at 15:00
  • Okay, figured it out, the command I'm looking for is 'focus'. Anyway, thanks @Timothy Brackett, this comment gave me the clue I needed (use 'bind' not 'bindkey') to be able to figure the rest out from the docs. Thanks! – stbrody Oct 31 '20 at 15:02
  • No problem. I switched to tmux years ago, and no longer have screen installed on any of my systems. – Timothy Brackett Oct 31 '20 at 15:10
  • Edited answer to show the behavior that you want. – Timothy Brackett Oct 31 '20 at 15:11
0

Okay figured it out, the proper invocation is bind o focus next

2
  • so, please delete your this answer and mark @TimothyBrackett's answer as accepted – αғsнιη Nov 4 '20 at 19:48
  • He changed his answer to be correct after I posted this. Now that it's been updated I can take his if that's better. Although now our discussion in the comments on his answer makes less sense now that the text has been changed... – stbrody Nov 5 '20 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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