I saw some body split their window to 2x2, I just want to know how to do that? I know the 'split' command in Screen can only split the window horizontally.
5 Answers
The latest version of GNU screen allows you split the window vertically without any external patches. Here is one way to get it and use it:
- Checkout/clone/download the source
- Build it in an easy sequence of
./autogen.sh
,./configure
,make
andinstall
. I didn't have any problems with dependencies on Mountain Lion. To get a vertical split use:
C-a | // Create a split C-a <Tab> // Move to the split C-a c // Create a new window within the split
I don't think this is a reason to switch to tmux any more like others have been suggesting.
-
3Is it possible to preconfigure screen to autostart with multiple splits ? – Fedir RYKHTIK Apr 03 '13 at 13:41
-
-
5Sure! You have to add
split
,split -v
andfocus
commands in the screenrc file. Even you can place screen inside another screen to make complex configurations. – Kondybas May 27 '14 at 01:28 -
5@Kellen: When you say "The latest version ..." which version do you mean? I have Screen version 4.00.03 (FAU) 23-Oct-06, but neither
C-a |
norsplit -v
work. For example, when I execute thesplit -v
command the error message issplit: no arguments required
– John Prior Jan 21 '15 at 19:30 -
@JohnPrior "From macports (Mac OS X): Screen version 4.02.01 (GNU) 28-Apr-14" has the ability to vertically split. As does "From apt-get (Ubuntu 14.04.1 LTS): Screen version 4.01.00devel (GNU) 2-May-06" – Dave Albert Apr 25 '15 at 08:35
-
4To unsplit a window again, you can continue reading here: Unix: How to unsplit in screen – hakre Jul 15 '15 at 07:23
-
@DaveAlbert, I installed Screen 4.06.02 via Brew on my Mac. Could not do a vertical split still. :( – rrrocky Feb 22 '18 at 07:24
Check out the video tutorial on Split Screen with Screen in Linux - BASH . At time 2:00 minute, there would be a solution.
Ctrl+A, Shift+S # Create another window
Ctrl+A, Tab # Moving from another window
Ctrl+A, c # Create new session
Ctrl+A, | # Splitting vertical (pipe symbol)
Ctrl+A, Shift+S # Splitting horizontal
Ctrl+A, Shift+X # Close a window

- 1,126

- 571
-
2Note that to close a region it's capital
X
meaningctrl-a shift-x
. If we doctrl-a x
(small x) it actually causes the screen to lock. – Daniel Nov 18 '21 at 11:43
-
24Note: This is no longer true. Vertical splits are part of the official source and Ubuntu packages ship with the functionality built in. – JaredMcAteer Feb 20 '13 at 15:49
-
1@JaredMcAteer, it may be part of the official packages Ubuntu ships with, but the newest release of screen available through the GNU screen project page is 4.00.03, released in 2006. They may have the functionality in their git repo, but it's not part of a release yet as far as I've found. – Brian Vandenberg Oct 14 '13 at 20:58
-
9I hate answers where it's suggested to use another software. +1 for [tag:tmux] nonetheless. – pfnuesel Jan 30 '14 at 01:58
-
1I think stack should take an accepted answer, once ANOTHER answer surpasses it in points, turn the accepted check-mark yellow, then add the green check-mark to the highest voted.
This is totally based upon the simple fact, that the GREEN check-mark is supposed to the more realistic figure. However that is not the case. The REALISTIC figure is the one with the HIGHEST VOTES, almost always.
I.E. this green check is not the answer, see the highest voted..
– Brian Thomas Mar 18 '16 at 23:16 -
-
@BrianVandenberg the official sources are in git. The latest version there does support vertical splits. – Ruslan Jul 23 '17 at 15:53
-
This answer tells that screen supports vertical splitting as the OP asked and is not even telling how. This answer should be hidden due to too many downvotes. – ohcibi Nov 30 '18 at 22:15
-
Use the -v
option to split
command in screen
. From the manpage:
Split the current region into two new ones. All regions on the display
are resized to make room for the new region. The blank window is dis‐
played on the new region. Splits are made horizontally unless -v is
used. Use the "remove" or the "only" command to delete regions. Use
"focus" to toggle between regions.

- 22,536
-
-
-
-
-
4
-
8So, in order to input commands in screen, one needs to do
C-a :
(control a, colon). There you can dosplit
orsplit -v
.C-a |
is a shortcut for a vertical split, though. – droope Jul 07 '14 at 05:00
A WITHOUT using bind-key open way
Since I google out many of videos are telling us to use bind-keys, I tidy up some steps that we can open GNU screen by code...
- save the following context to
~/.screenrc
or/etc/screenrc
or any text file
screen 1 top split -v focus right screen 2 python3 -m http.server 0 split -v focus right screen 3 nano .bashrc
Note: change the command top
, python3 -m http.server 0
, nano .bashrc
as you want
- run the following command
screen
or
screen -c ~/.screenrc
Note: If your file DID NOT save to ~/.screenrc
or /etc/screenrc
, the first command would become NOT WORKING.
- enjoy your split windows
Note: If the command terminated, the split window will become blank. To solve this problem, you can run exec echo "hello world"
instead.
- close GNU-screen by Ctrl+A, \
Reference:
Vertically way
screen 1 top split focus down screen 2 python3 -m http.server 0 split focus down screen 3 nano .bashrc

- 21
tmux
instead. – xenoterracide Dec 13 '11 at 06:44