After searching through, I figured ctrl+b ( PREFIX ) then ctrl + arrow should resize the current pane. But it is not working. Am I missing anything ?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Probably your terminal is not sending a (distinct) sequence when you hold Control and press an arrow key.
cat and typing the keys into it (Control-C to quit). You will probably find that (e.g.) Up and Control-Up both generate the same sequence.
In its default configuration the OS X Terminal application sends the sequence
^[OA) whether you type Up or Control-Up (also any combination with Shift and Option, too).
However, you can reconfigure Terminal to send appropriate codes. It is a bit tedious, but you usually only have to do it once.
click the plus button to add a new binding
\033) followed by
[1;5and one more character:
Cfor Right, or
For example, the final sequence for Control-Up should end up looking like
These sequences are the ones that XTerm generates (see the ctlseqs documentation for details).
Repeat the last step for the other arrow keys.
iTerm 2 sends the expected sequence by default.
On at least Mavericks and iTerm2, you have to hold
Control, then press
b (instead of holding), then hold down a directional button. This sends pretty much the same sequences as holding down
b with a directional button so it works.
Also, make sure to head over to keyboard settings and in shortcuts tab disable any mission control and such keyboard shortcuts you may have for
Control plus a directional key.
You can use the meta key instead of the control key in the ctrl-↑ and ctrl-↓ combinations. In OSX Terminal the default meta key is the escape key. For example, to increase the size of a pane type ctrl-b esc-↑.
I find the escape key a pain to reach so I use the option key as the meta key instead. In Terminal.app you can change it by going to Terminal > Preferences > Profiles > Keyboard : check the "Use Option as Meta Key".
Now you can type ctrl-b option-↑ to increase the size or ctrl-b option-↓ to decrease the size and you don't have to remap the mission control keys.