News for hackers. Stuff that matters.

Ask HN: Which is better tmux or screen?

Before you go on pointing me to archives or asking me to google understand that I have done that. The reason for asking is all the comparisons are by now old. I ask now because both might have progressed a long way. I personally use tmux but am not a pro user. I want to know if there is something that tmux has that screen doesn't have or vice versa. I would also like to know which is more light weight, more configurable.

Also I would really like to know the scenario of how you use either.

Thanks,

AM

( 9 comments | 9 points | on HN )
Re:Ask HN: Which is better tmux or screen? by dllthomas on Friday April 14, 2017 @03:36PM (#14116634)
I use screen, but there's no real reason for it but inertia. I don't know of anything it does better than tmux (except, perhaps, being available more places).

I use it, plus some scripts, to keep my work separated into various contexts. See https://github.com/dlthomas/config-files/blob/master/bin/ses... and https://github.com/dlthomas/config-files/blob/master/.bash.d...

The single biggest win is keeping a separate bash history per context. But it's also very handy to define context specific functions and aliases, cd at start to a relevant directory, etc.

Putting it all inside screen means that I can trivially start a new shell in the same context and gives a nice grouping.

Re:Ask HN: Which is better tmux or screen? by atmosx on Saturday April 15, 2017 @04:49AM (#14119978)
What I've always missed going from screen to tmux is the ability to keep logs. "screen -L" will do the trick, while in tmux I need to install a plugin.
Re:Ask HN: Which is better tmux or screen? by archmonk on Friday April 14, 2017 @03:49PM (#14116732)
Interesting I didn't know that in screen you could isolate bash history per context.
Re:Ask HN: Which is better tmux or screen? by dllthomas on Friday April 14, 2017 @05:08PM (#14117390)
It's not screen doing the work.

Screen is just a process that spawns other processes, and like always those inherit environment variables. The script I have that starts screen defines a variable called "SESSION" beforehand, and that's used in my bashrc to set HISTFILE (and other things). Screen is just how I organize it.

Re:Ask HN: Which is better tmux or screen? by sigjuice on Friday April 14, 2017 @07:38PM (#14118310)
I don't think tmux can talk to serial ports. I am primarily a tmux user, but use screen if I need a serial console. e.g.

   screen /dev/ttyUSB0 115200
Re:Ask HN: Which is better tmux or screen? by mod on Friday April 14, 2017 @04:46PM (#14117208)
I've never used screen, but I love tmux.

I particularly love tmuxinator and using it to set up complex environments, like sourcing a virtualenv in python on all my windows/panes.

I use tmux for my main development environment, which usually has:

Window 1 (2 panes): vim and tests Window 2: bash console, used for git or one-off tasks Window 3: console (python/ruby REPL, usually) Window 4: localhost server (running whatever webapp I'm working on)

Re:Ask HN: Which is better tmux or screen? by caspervonb on Friday April 14, 2017 @03:26PM (#14116562)
Use screen mostly, reason is simple, its the one i started using first and it's installed by default on most servers.

Objectively, I really don't know.

Re:Ask HN: Which is better tmux or screen? by __DarkBlue on Friday April 14, 2017 @04:48PM (#14117226)
Same here. I use screen mostly because it's generally available, whereas tmux usually has to be installed.
Re:Ask HN: Which is better tmux or screen? by jtchang on Friday April 14, 2017 @10:57PM (#14119095)
I've used both. I kinda like how tmux has a bottom bar by default. Both are super stable and I haven't had either crash on me ever.

Configuring both are kinda of a pain. I can never seem to get scroll to work properly in mac os x. I don't think I ever tried in screen. tmux is shorter character wise :)