Home » Questions » Computers [ Ask a new question ]

How to get vertical split of terminal in Mac to execute different actions?

How to get vertical split of terminal in Mac to execute different actions?

Every once in a while I see people using what looks like terminal in their Mac, except that in what seems to be one window they have a vertical 'split.' On one side of the split, they have emacs or something, and in the other they have something else.

Asked by: Guest | Views: 55
Total answers/comments: 5
Guest [Entry]

"Possibly GNU Screen with vertical split?

It should already be installed on your Mac, type screen in the terminal.

You can also do this with emacs by itself."
Guest [Entry]

"If you like to work with your terminal windows in fullscreen, you can use macOS' built in screen splitting feature like so:

Open two terminal windows
Toggle one of the terminal windows fullscreen
Activate 'Mission Control' (default: F3)
Drag the second terminal window onto the first's fullscreen space
Enjoy your vertically split fullscreen terminal windows

You can switch keyboard focus between terms with ⌘-[ and ⌘-]"
Guest [Entry]

"John T's accepted answer (GNU screen, accessed with screen) was what I needed, but I needed a few minutes learning some basics to make it useful. Here is the jump start I needed on key bindings (straight from the man page) - note that you need to install the GNU version for vertical splits (listed after the FAU version that was in my Mavericks).

Also, I highly recommend you skim man screen to see what suits your needs. You can always just launch another terminal using screen and then read the manual...

Screen version 4.00.03 (FAU) 23-Oct-06

(included in Mavericks and likely similar in earlier)

The following table shows the default key bindings:

C-a ' (select) Prompt for a window name or number to switch to.

C-a "" (windowlist -b)
Present a list of all windows for selection.

C-a 0 (select 0)
a| a|
C-a 9 (select 9)
C-a - (select -) Switch to window number 0 - 9, or to the blank window.

C-a tab (focus) Switch the input focus to the next region. See also split, remove, only.

C-a C-a (other) Toggle to the window displayed previously. Note that this binding defaults
to the command character typed twice, unless overridden. For instance, if
you use the option ""-e]x"", this command becomes ""]]"".

...

C-a S (split) Split the current region into two new ones.

...

C-a ? (help) Show key bindings.

C-a \ (quit) Kill all windows and terminate screen.

...

C-a * (displays) Show a listing of all currently attached displays.

Additional items with 'Screen version 4.02.01 (GNU) 28-Apr-14'

(installed using sudo port install screen just now)

All of the items listed above in the 4.00.02 (FAU) version, as well as:

C-a S (split) Split the current region horizontally into two new ones. See also only,
remove, focus.

Same above, but this clarifies that it is horizontal.
...

C-a | (split -v) Split the current region vertically into two new ones."
"John T's accepted answer (GNU screen, accessed with screen) was what I needed, but I needed a few minutes learning some basics to make it useful. Here is the jump start I needed on key bindings (straight from the man page) - note that you need to install the GNU version for vertical splits (listed after the FAU version that was in my Mavericks).

Also, I highly recommend you skim man screen to see what suits your needs. You can always just launch another terminal using screen and then read the manual...

Screen version 4.00.03 (FAU) 23-Oct-06

(included in Mavericks and likely similar in earlier)

The following table shows the default key bindings:

C-a ' (select) Prompt for a window name or number to switch to.

C-a "" (windowlist -b)
Present a list of all windows for selection.

C-a 0 (select 0)
a| a|
C-a 9 (select 9)
C-a - (select -) Switch to window number 0 - 9, or to the blank window.

C-a tab (focus) Switch the input focus to the next region. See also split, remove, only.

C-a C-a (other) Toggle to the window displayed previously. Note that this binding defaults
to the command character typed twice, unless overridden. For instance, if
you use the option ""-e]x"", this command becomes ""]]"".

...

C-a S (split) Split the current region into two new ones.

...

C-a ? (help) Show key bindings.

C-a \ (quit) Kill all windows and terminate screen.

...

C-a * (displays) Show a listing of all currently attached displays.

Additional items with 'Screen version 4.02.01 (GNU) 28-Apr-14'

(installed using sudo port install screen just now)

All of the items listed above in the 4.00.02 (FAU) version, as well as:

C-a S (split) Split the current region horizontally into two new ones. See also only,
remove, focus.

Same above, but this clarifies that it is horizontal.
...

C-a | (split -v) Split the current region vertically into two new ones."
Guest [Entry]

"After you vertically split on screen, you can type screen to create new instance.
Or you can also use iTerm or iTerm2 which can use vertical split. See this link for splitted panes. www.iterm2.com/#/section/features/split_panes"
Guest [Entry]

"very similar to John T's answer about screen, but you can also do this with tmux (http://tmux.sourceforge.net/).
Nice thing about tmux compared to screen is that the vertical split feature comes even with the version you can get from packages(macports or homebrew for Mac, apt-get for ubuntu etc.)."