From vi
, if you issue the command :sp
, the screen splits into two "views", allowing you to edit more than one file from the same terminal.
Along those same lines, is there a way to have multiple shells open in the same terminal?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYou can do it in screen
the terminal multiplexer.
Note: After splitting, you need to go into the new region and start a new session via ctrla then c before you can use that area.
EDIT, basic screen usage:
ctrl+a
then release everything then shift+s
(don't know for caps lock, mine is disabled)
Dec 5, 2011 at 12:43
Ctrl A Shift S
splits the screen, then Ctrl A Tab
switches to the other split, and Ctrl A c
creates a bash prompt. Is there anyway to have these commands run automatically when starting screen
so we don't have to run the commands all the time.
Sep 19, 2012 at 14:22
tmux
help resources are: intro, config, primer and cheat-sheet.
Dec 10, 2017 at 10:49
byobu
(which wraps both terminal multiplexers), but Tmux seems to be superior in several aspects other than the configuration. And was already superior several years ago. Screen needed patches for splitting both directions and Tmux had it out of the box. last but not least the license may be an argument for Tmux or Screen, depending on where you stand.
May 7, 2018 at 20:59
screen
is missing from a relatively fresh install of Fedora 30, while tmux
is present.
As mentioned in the comments, besides screen, another good terminal multiplexer is tmux. You can refer to the manual for a complete description and command reference. Some basic operations to get started are:
You can achieve more complex layouts by splitting panes. You can also have multiple windows with panes and switch between them.
If you want a program that just splits a terminal¹, there's splitvt. There are programs that split a terminal and do a lot of other stuff besides, such as Screen, Tmux, Emacs, …
apt install splitvt
does the trick. Is there a way to split vertically?
Apart from the excellent suggestions on Screen and Tmux if you are using some sort of window manager you may be interested in Terminator you can split horizontally or vertically fashions, plus tabs and more... here's a list of features taken from the author's web site:
Have a look to the screenshots on the project site.
Most important you can combine Terminator with Screen/Tmux.
ctrl-shift-h/j/k/l
for moving between panes, and ctrl-(shift)-tab for switching between tabs, it just works awesome.
same terminal
twice, so Terminator or tilix (as mentioned by @sjas) are not good suggestions. If you are in an ssh session to a remote server with no X server, you will not be able to even run these tools.
Konsole for KDE has a built in function:
Ctrl+( to Split View Left/Right
Ctrl+) to Split View Top/Bottom
Shift+Tab will cycle through the split views
Shift+Left Arrow/Right Arrow will cycle the current view through the tabs/views
Ctrl+Shift+X to close the current view
Use terminator.
Should be available via your favourite package manager, if you use a mainstream distribution.
It is the only terminal multiplexer where copy-pasting works properly from within panes in your window.
Update: tilix
is a terminator
alternative which is almost completely on par with terminator (and where copypasting works properly, too). After evaluating it I still stick with terminator
however due to nicer tab handling and easier configuration (from my POV).
Here I wrote a more complete answer.
I'm a happy user of Guake with Byobu inside it, which by default uses tmux
(probably better than screen
) as backend.
Install them (no PPAs needed on Ubuntu/Debian, check for other distros)
sudo apt install guake byobu
Add it to available shells (as told in this Guake Github issue):
which byobu | sudo tee -a /etc/shells
On Guake preferences (guake-prefs
) choose Byobu as the default interpreter:
Guake
Byobu
apropos byobu
Try Vertical Split for GNU Screen
This patch provides a vertical split feature for current releases of GNU Screen. The feature is designed to function in the same manner as screen's existing split command, but dividing the regions vertically instead of horizontally. Both forms of splits can be used together in any combination/quantity/order desired. Something similar is slated to appear in GNU Screen 4.1 soon, and is already available in CVS per this mailing list thread (and has been included in the Debian and Ubuntu screen packages starting with 4.0.3-10). Also, a recent project named ScreenWM is designed specifically to work with a vsplit-patched screen (check it out!).
Ctrl+|
splits the screen
in Ubuntu right off the bat.
Oct 23, 2016 at 18:17
Vim
can also be used as a rough terminal multiplexer:
:terminal
opens a horizontial split terminal,
:vertical terminal
opens a vertical split terminal.
As always the commands can be assigned to keyboard shortcuts.