How to switch gnu screen windows in iTerm2 via keyboard shortcuts

I’m obsessed with having optimal keyboard shortcuts with whatever program. I recently switched from using client-side textmate to server-side vim as I want to move as much as possible to the cloud.

I have looked for a good way to switch windows in gnu screen for a long time without having to use ctrl-a 1. That’s what I came up with:

In Preferences, map your keys (e.g. cmd-1 or alt-1) to action: send hex code.
The hex code depends on what is your “screen key”.

Screen key ctrl-z

Screen
number
hex code
1 0x1a 0x31
2 0x1a 0x32
9 0x1a 0x39

Screen key ctrl-a

Screen
number
hex code
1 0x01 0x31
2 0x01 0x32
9 0x01 0x39

What is they key stroke in hex?

If you want to map other commands, here is a good resource

Leave a Reply