tmux vs. GNU Screen
Solution 1
From their website:
- How is tmux different from GNU screen? What else does it offer?
tmux offers several advantages over screen:
- a clearly-defined client-server model: windows are independent entities which may be attached simultaneously to multiple sessions and viewed from multiple clients (terminals), as well as moved freely between sessions within the same tmux server;
- a consistent, well-documented command interface, with the same syntax whether used interactively, as a key binding, or from the shell;
- easily scriptable from the shell;
- multiple paste buffers;
- choice of vi or emacs key layouts;
- an option to limit the window size;
- a more usable status line syntax, with the ability to display the first line of output of a specific command;
- a cleaner, modern, easily extended, BSD-licensed codebase.
There are still a few features screen includes that tmux omits:
- builtin serial and telnet support; this is bloat and is unlikely to be added to tmux;
- wider platform support, for example IRIX and HP-UX, and for odd terminals.
Solution 2
One difference is in how the two act when multiple terminals are attached to a single session.
With screen, each attached terminal's view is independent of the others. With tmux, all attached terminals see the same thing.
Say you have two terminals attached to a single tmux session. If you type ^B 1 into one terminal, the other terminal also switches to window 1.
When you have two terminals attached to a single screen session, and you type ^A 1 into one, it has no effect on the other terminal.
This is based on my experience with tmux 1.2; I see 1.3 is out but I didn't notice anything in the changelog about this behavior changing.
If you like the screen behavior and want it in tmux:
If your original tmux session is called 0
(the default), then you can do tmux new-session -t 0
) to start up a new independent session connected to the same set of windows, which can then have its own view.
Solution 3
tmux is fairly new compared with GNU screen. Advantages / Disadvantages is a tough question, as both programs solve approximately the same problem. tmux is BSD licensed while screen is GNU GPL. This matters to some people.
screen is more represented (on Linux) at the moment, that is, you are more likely to find it on a given linux box than tmux. tmux is however more represented on OpenBSD as it is included as part of the base install.
Both programs allow you to do about the same thing, though the state of things is a bit more complex than that. Switching between the two is not overly complicated, as much of screens functionality has also found its way into tmux, though if you are a power user of either one, you will likely find some frustrations when switching to the other.
As with any program, it really depends on your needs, and which you are more comfortable with. Give them both a try and see which you play nicely with.
For more info on tmux see https://tmux.github.io/
Solution 4
I thought I would just mention about the byobu
wrapper that is available for screen that makes it so much better right out of the box. I don't know if something like this is available for tmux, but byobu
made my .screenrc only a handful of lines. Check out this quick article about byobu and screenshots. The project page for byobu describes the name originating from a Japanese term for decorative, multi-panel screens that serve as folding room dividers. Also, just running it doesn't harm your screen settings, so you can safely try it. Once you start the session with byobu
you can freely reconnect to it using screen
and still not loose any customizations done by byobu
(so use it only for the initial invocation). The two main advantages of it are:
- Starts screen with a couple of status bars with useful information
- Provides many keybindings to access screen's functionality easier
I am not using the keybindings part, but definitely find the status bars useful.
Also you might find Screen Vs tmux link useful. I think most of it is already mentioned by existing answers.
Solution 5
The biggest difference in my use has been that in Gnu Screen you can only split frames horizontally, whereas in Tmux you can split both horizontally and vertically. This is kind of a moving target, though as I here tell that vertical split is making it's way into screen.
Other then that, things are about flat.
Related videos on Youtube
Louis Gerbarg
Updated on September 17, 2022Comments
-
Louis Gerbarg over 1 year
Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.
-
Lloyd Dewolf almost 13 yearsAlso discussed at superuser.com/questions/236158/tmux-vs-screen
-
reinierpost about 7 yearsAs you can see from the good answers below, they are not opinion-based.
-
Jarek over 5 years@reinierpost - it seems many people here are too quick to close questions as "primarily opinion-based". However, we can vote to reopen.
-
peterh over 5 yearsAlthough this question is a comparison question, I think the pro and contra arguments are enough objective and thus the opinionatedness close reason is not okay here. You can check the linked SU question, the answers are pretty okay.
-
Ajay Brahmakshatriya over 4 years@MountainX you claim that this question is not opinion based, but the accepted (and the most upvoted) answer makes comments like - ...this is bloat and is.... The problem with such questions is that it leads to opinions being presented
-
Ajay Brahmakshatriya over 4 years@user259412 see my comment above.
-
peterh over 4 years@AjayBrahmakshatriya Obviously "this is bloat"-like answers are opinions. But a list, that "X can ..., ... and .., while Y can ... and ..." are objective. I think the "this is bloat" could be edited out from that answer (considering its score, I did not do it, but I also did not vote them).
-
-
xenoterracide over 13 yearsdamn... now I want to try tmux... just because screen didn't work for me due ot lack of vi keybindings.
-
Jerry Nixon over 13 yearsyou can split vertically in screen as well. mmm... at lest it works in default Ubuntu 10.10 screen install.
-
lindes about 13 yearsThis is an interesting distinction. I'm sure each of these has advantages, for different use cases. (tmux advantage: two people attached to same tmux session e.g. for remote pair programming would always see the same thing; screen advantage: one person attached to the same screen from two places for two different purposes can have two different views, even simultaneously (with, say, side-by-side (OS/windowmanager-level) windows).)
-
mike3996 about 13 yearsI haven't had scrolling with screen like ... ever? :/
-
xenoterracide about 13 years@andre there's been a long standing patch for vertical split in screen... that was never incorporated into upstream... but I'm sure many distro's applied it.
-
xenoterracide about 13 yearsyeah my TE supports scrolling and screen breaks it... I have to scroll with screen. -1 does not appear to be accurate.
-
Louis Gerbarg about 13 years@xenoterracide: Hmm. You are partially right. Screen on some distros/systems (older Gentoo) does not break it while on some (new Ubuntu) it does. I have no idea why.
-
xenoterracide about 13 yearspossibly a patch... ours are all 5.5 cent systems
-
Gilles 'SO- stop being evil' about 13 yearsYour answer would be more useful if you summarized the features of
byobu
, like this answers with its list of features. -
haridsv about 13 yearsOK, I added more information on
byobu
, but it is as simple as running the command and finding it for yourself (it is menu driven), since it doesn't messup your existing screen settings. And I made my answer a community wiki, so feel free to edit it. -
jw013 over 12 yearsDoes vi or emacs keybindings just mean tmux comes with a two convenient sets of defaults? It is possible to completely reconfigure screen's keybindings with its rc file.
-
nisc over 12 yearsYou can define arbitrary key bindings. See: openbsd.org/cgi-bin/…
-
Cos over 12 yearsif your original tmux session is called "0" (the default), then you can do "tmux new-session -t 0") to start up a new independent session connected to the same set of windows, which can then have its own view. I'm pretty sure this worked back in 1.2/1.3, but I can't remember offhand.
-
jrwren about 12 years@cos this is exactly the tip for which I was looking. Thank you so much. I wish I could up vote you twice :) I'll start reattaching with 'tmux new-session -t 0' every time now.
-
Darael almost 12 yearsbyobu appears to actually support tmux as well, at least in more recent versions.
-
Michael Durrant over 11 yearsThat's good to know. I've now been using it for a year and didn't notice any need for polish although a little hungarian might help. Notation that is. ok bad pun ;) Hadn't used screen before it so not noticing the issues mentioned. Would find it harder to switch to screen and lose the new features now.
-
yo' about 10 yearsWhen they speak about implementing, they should finally solve the stupid bug with
<C-Left>
invim
intmux
. -
user285259 over 6 years@Cos This was added "FROM 1.0 TO 1.1, 05 November 2009". @jrwren The command can be shorted
tmux new -t 0
.