
Why You Should Try tmux Instead of screen - andrewfromx
http://dominik.honnef.co/posts/2010/10/why_you_should_try_tmux_instead_of_screen/
======
josteink
I've used screen for years and years and because of the noise around tmux, I
decided to try to give it a spin.

In the end (rather quickly actually) I went back to screen. It's simple. It
works. It's reliable, mature and stable. It has the "proper" keybindings which
has been around for decades for this kind of software.

Whatever tmux was supposed to provide of additional value I could not find.

Edit: I see that this article (from 2010) says screen doesn't have a menu to
select buffers. That's factually incorrect. That feature must have been there
already before tmux was started?

~~~
dozzie
Add `dvtm' inside `screen' session to your toolbelt. Splits your terminal into
few other terminals you can arrange in several ways.

~~~
GrinningFool
Is there additional functionality over native screen (or tmux) capabilities
that appear to do the same thing?

~~~
dozzie
I don't know, I've never bothered to read tmux' docs. As I hear from
colleagues, there's none, apart from more friendly learning curve (dvtm
doesn't try to handle sessions).

~~~
dozzie
Correction: screen is terrible on the ground of splitting terminal in several
pieces. dvtm fills this space elegantly.

------
Morantron
I've been using tmux for a while. What I like most is the copy mode and its
scriptability.

Copy mode allows you to select and copy text using vi or emacs ( whatever you
choose ) key bindings. This way, you can go completely mouse free in the
terminal. This is also present in screen.

Then scriptability: tmux exposes lots of commands so you can interact with it
from a script. There are quite a few plugins out there.
[https://github.com/tmux-plugins/](https://github.com/tmux-plugins/)

My personal favourites:

\- [https://github.com/morantron/tmux-
fingers/](https://github.com/morantron/tmux-fingers/) copy pasting using
vimium-like hints, so you don't even have to enter copy mode ( this one I did
it myself </shameless-plug> )

\-
[https://github.com/tmuxinator/tmuxinator/](https://github.com/tmuxinator/tmuxinator/)
predefined user sessions. Solves repetitively opening the same
services/commands every time you start a coding session.

------
rcarmo
I've been using tmux for years now, and the last time I had to use screen
(because it was the only thing pre-installed on a server) it felt like going
back to the Dark Ages.

Only gripe I have with it is that copy-paste can be fiddly, but that's
terminals for you.

------
danmaz74
I'm not a heavy user, but I recently moved from screen to tmux. I initially
chose screen because it is installed by default practically everywhere. But
tmux is better, so, my take is this: choose tmux unless you'll need to work on
servers where you can't get tmux installed.

~~~
otterley
Why is tmux better?

~~~
Sir_Cmpwn
Here's an article explaining how tmux is better:

[http://dominik.honnef.co/posts/2010/10/why_you_should_try_tm...](http://dominik.honnef.co/posts/2010/10/why_you_should_try_tmux_instead_of_screen/)

~~~
coredog64
That's an interesting article, but do you have a pointer to any discussion of
it?

~~~
Mchl
Here's a discussion about such an article:

[https://news.ycombinator.com/item?id=12024794](https://news.ycombinator.com/item?id=12024794)

------
dreamsofdragons
I started with screen, but moved to tmux around 5 years ago. For me, the sell
was in custom layouts, and the no nonsense screen splitting. I usually work on
several different project types, and have a scripted layout for each the of
project types. This makes getting started in the morning instant.

Tmux is great, but only after customizing it and making it your own, and this
can take a fair bit of time. If you find yourself shelling into remote servers
you don't control, or want to use it on Windows prior to Windows 10, then
screen is probably a better choice. While tmux could be used on windows
through cygwin, I never found it to be stable enough for day to day use.

------
zimbatm
One thing I found tmux surprising for is how it inherits environment variables
from the parent process and then loads the profile on top. This makes the
resulting environment unusual.

Instead it should either leave the environment as it, or create clean login
shells.

~~~
slgeorge
I thought the default was to create a login shell? See the "Start a non-login
shell" section on the Arch Wiki[0]. I turn that off with the option mentioned
there: that way it inherits from my current environment - I probably
misunderstand what you mean by "inherit" versus "leave the environment as is".

[0]
[https://wiki.archlinux.org/index.php/tmux](https://wiki.archlinux.org/index.php/tmux)

------
j0rd
Pick one and use it.

I personally use screen, because it's what I learnt years & years ago. I also
like that sometimes it's there by default when I login to a new server.

...but most linux "power users" prefer tmux.

~~~
andrewfromx
exactly what I thought. Screen is there by default always and tmux would have
to be installed sometimes. So maybe I should pick screen even though tmux is
more modern and better? Tough choice really. I could see myself on some server
someday without the time/option to install tmux and trying to learn screen in
5 mins.

~~~
weitzj
I use vim to be prepared for a new server, but do not stay with screen to be
prepared.

I only once had a need (easy copy paste in terminal) to get tmux running on a
server with no SSH, so I installed it.

For all other machines, which do not have tmux installed I use my local
machine and SSH/MOSH with my local tmux. If there is a need to have a long
running command on a server, I use tmux to detach the session, fallback to
screen for detaching, fallback to SSH nohub

~~~
j0rd
cheatmode is have a local statically compiled version of tmux ready to godmode
servers you can SCP files to (all of em, if you've got ssh most likely)

That's what I'd do, if a server doesn't have screen/vim and sysadmins are
being a nuisance.

~~~
tanderson92
Unfortunately, the most recent tmux will not build statically.

------
ZeWaren
Don't forget neercs!

It has the most useful feature of all: a rotating 3D cube.

~~~
fennecfoxen
Somehow that seems even less useful than sl(1).

------
beagle3
byobu

it can use either as a backend, and makes them better IMHO. YMMV.

------
mivade
I was using tmux for a while after years of using screen. At least for my use
case, the main thing I liked better about tmux was that windows (or whatever
the proper term is) get their names updated based on the command running. In
screen, I would have to manually change the name (maybe there is a way around
this but I was always too lazy to find out).

Why I switched back to screen:

1\. It's more commonly installed. Not a big deal these days, but still.

2\. It's _really_ easy to resize a window to fit whatever terminal window I'm
using: C-a F. As far as I could find, there is no way to do this with tmux.

------
jonathan_s
Also check out pymux:
[https://github.com/jonathanslenders/pymux](https://github.com/jonathanslenders/pymux)

~~~
Perixoog
>When several clients are attached to the same session, each client can watch
a different window. When clients are watching different windows, every client
uses the full terminal size.

Nice.

~~~
luchs
Tmux supports this as well, just use "tmux new-session -t xy" instead of "tmux
attach-session -t xy".

------
daviddavis
The last time I used screen it didn't allow you to split windows vertically.
This was 2-3 years ago. Is that still true?

~~~
IE6
I usually use screen in a very vanilla way (i.e. logged into some rhel box I
didn't build or configure) and in my experience you still cannot split
vertically. x_x

~~~
bizarref00l
ctrl-a | is there from long more than 3 years, in the manual page for those
willing to read it.

~~~
IE6
Unfortunately for me most of the applications I have access to (and want to
have installed) do not have custom patches including functionality like that.
I'm left with C-a S as my only native option.

------
vitohuang
Tmux - the config is so much easier to understand and shortcuts as well

------
jvandonsel
Why would one prefer tmux or screen over multiple ssh sessions on a nice
tabbed terminal program like iTerm2 ?

~~~
jjnoakes
Because if your network drops the connections, you can resume with tmux or
screen, but not with vanilla ssh.

~~~
jiqiren
This is solved with mosh: [https://mosh.mit.edu](https://mosh.mit.edu)

Uses UDP/protobuffs so network connection can be lost/changed/etc.

~~~
josteink
And since almost nobody uses mosh (and let's not talk about security
implications of its implementation), problem is not really solved at all.

You know, from a practical point of view.

------
pwelch
There's also tmate which makes it easy to share a tmux session over ssh.

Not sure if there is something similar for screen.

~~~
bizarref00l
multiuser ?
[https://www.gnu.org/software/screen/manual/html_node/Multius...](https://www.gnu.org/software/screen/manual/html_node/Multiuser-
Session.html)

------
cm3
If someone's looking for a third option: combine abduco with dvtm.

~~~
alch-
Woah, tiling window management for the console! That is so awsesome. Thank
you, good sir.

