DEV Community

Devs, why do you use terminal tabs over tmux windows?

Martin Becker on March 06, 2018

Just a quick thought, I've noticed a lot of developers seem to use terminal tabs, even when using tmux which has windows, so I'm curious, why use t...
Collapse
 
maestromac profile image
Mac Siri

I actually have an opposite question for a long while now: Why would you choose to use Tmux to manipulate multiple windows when you have the native terminal tab that is working right out of the box?

Don't get me wrong, I am an active Tmux user. I use Tmux because it goes well with vim, I get to see my CPU's stat with tmux-mem-cpu-load plugin, and I occasionally need to use SSH on my work machine. But this whole thing would take a lot of convincing if I'm using other text editor and having no need to SSH. Screen real-estate won't be an issue for me either since I have a big monitor.

Collapse
 
dmerand profile image
Donald Merand

I've been using tmux for maybe 1/2 a year now (after years of reading hype), and can say that it's definitely replaced terminal tabs for me. There's a strong argument to be made for using the same tool across all local + remote machines - it's much faster under the hands.

I use tmux sessions + panes all the time. I've usually got 4-8 named sessions (which correspond to code repos typically), each with three or so panes, running on my main machine. Each server to which I periodically connect is running another few sessions. However, I don't see the point of windows in tmux, and have never once used them.

My reasoning is: you can name a session (prefix-$), and you can easily list sessions (prefix-s), so it's easy to know where you are with them. Panes are obviously helpful for viewing things side-by-side. But windows can disappear without a trace - it's hard to know how many windows you have open in a session, and it's hard to see what's going on with your windows all at once.

I think this is an idiosyncratic approach, but I've found tmux much more approachable by simply cutting windows entirely out of the equation and focusing on sessions + panes.

Collapse
 
ben profile image
Ben Halpern

@maestromac thoughts?

Collapse
 
val_baca profile image
Valentin Baca • Edited

Command+#: one key combo, muscle memory (browser tabs use the same shortcut), native so it's near instant, can easily pull tabs out and move to another window, move into another window, or put side-by-side

Ctrl-b, #: two key combo, not-native (there's a lag equal to the tmux timeout)

To me: tmux does not have much use for terminals on my local machine.

I use tmux for any remote host, but locally tmux doesn't provide me anything. The only thing I'm worried about is my Mac giving a kernel panic. Tmux doesn't protect against that.

Vim can save sessions. My shell keeps my history, which I can Ctrl-r to search back through (P.S. adding a #comment to shell commands really helps with this). My paths are kept short or I use symlinks to quickly get back to where I need to be. I write scripts.

BTW iTerm has tmux integration so that iTerm tabs == tmux tabs. Just add -CC to any tmux commands.

Collapse
 
maxdevjs profile image
maxdevjs

my Mac giving a kernel panic. Tmux doesn't protect against that

A couple plugins help with such catastrophic scenario:

tmux-plugins/tmux-resurrect
tmux-plugins/tmux-continuum

Tried a couple times to check if it'd work, and it did as expected.

Restoring vim and neovim sessions never needed it, so no clues on how effective it is.