May 29, 2017

How to split up the Terminal on MAC?

Here is a quick tip to split the Mac - terminal horizontally to facilitate the switch between edit and execution in no time.

GNU Screen (screen from terminal) lets you do that on Mac

• Launch Terminal
• Type screen from Terminal
• Split Screen Horizontally: Press ctrl+a then release everything then press shift+s splits the screen
• Switch to other split: ctrl+a then Tab switches to the other split
• Create bash prompt in new split: ctrl+a then c creates a bash prompt; type exit to come out of command prompt.
• Un-split: ctrl + a then d to un-split the terminal

Note:
  1. Unlike Linux, the GNU Screen on MAC, lets you split the terminal only horizontally but not vertically. The above steps have been verified in OS X version 10.11.6
  2. Caveatctrl + a does not take the cursor to the beginning of the bash prompt in split window, as it is expecting for next command (either Tab or c )

iTerm for macOSX
Alternatively you may also download iTerm for macOS from here, which helps to split both vertically and horizontally
Use cmd + d for vertical split and cmd + shift + d for horizontal split
To navigate between the vertical splits in left/right or up/down fashion use cmd + [ / cmd + ]
iTerm 2 because of these features.