Any advantage of iterm over tmux?

On a mac environment, I am using iTerm instead of the default Terminal. On Learn, I see that tmux is promoted as a good productivity enhancer. I quickly read about tmux and from what I read from the initial chapters of Tmux productivity: Mouse free development, it seems it does the same as iTerm. I maybe wrong as I didn’t read the book fully but before I spend my time reading the entire book and watching the videos, I just wanted to ask you guys if tmux is still the industry standard tool or has it been outdated something else?

I use iTerm with Tmux. While there are advantages to iTerm over Terminal, I don’t find them that big of a deal. So iTerm or Terminal – up to you, though I would lean towards iTerm.

Tmux is just going to run within your terminal (it doesn’t matter if it’s Terminal or iTerm) Tmux just makes your terminal multiplex, you could think of it as a program that runs in Terminal (or iTerm.) Tmux isn’t an independent program – you have to run in in a terminal.

I highly recommend watching this video to see tmux and vim in action and give you a much better understanding: Chris Hunt - Impressive Ruby Productivity with Vim and Tmux - Ancient City Ruby 2013 - YouTube

I recently switched from using iTerm’s built in tabs and splits to using Tmux, and there are some benefits:

  • Tmux is more customisable: I can change the keyboard shortcuts, and script things without having to write AppleScript.
  • I can name my Tmux windows.
  • I can detattch from a Tmux session, restart iTerm (e.g. to install an update), and then re-attach to the same session.
  • Tmux’s copy mode let’s me use vim-like key bindings for navigating and searching terminal output.
  • The configuration file is plain text, so I can keep it in my dotfiles Git repository and share it between computers.
  • Consistent environment between Mac OS X and Linux.

Of course, there are some disadvantages too:

I’m not sure I’d describe Tmux as an industry standard, but it’s certainly popular, very actively developed, and something I’ll be sticking with for a while.

2 Likes

@georgebrock Thanks for the info.

I am trying to make the switch from native iTerm2 splits and tabs, and tmux simply doesn’t seem as fast or as smooth switching between and creating splits.A big gripe is that I cant hold my C-a leader, I have to press it in that order. I suspect that is an additional setting in .conf. Here is my minimal .tmux.conf

set -g prefix C-a
bind-key C-a send-prefix
unbind C-b

bind-key x kill-pane

# set vi mode
setw -g mode-keys vi

# enable mouse stuff
set -g mouse on

bind-key v split-window -h
bind-key s split-window -v

unbind r
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf updated :)"

Am I missing some additional settings that can make switching smoother? iTerm’s option-Cmd-arrow navigation is just too hard wired into my hands at this point. Thanks for any info.

Hi @ckahle33,

If I’m understanding correctly, you want to be able to change pane with a single keystroke, instead of hitting your tmux prefix (ctrl+a) followed by something else.

You can bind keys in tmux without a prefix, by passing the -n flag to bind-key, for example this will bind alt+ to move up a pane (as long as you have your alt key setup as a meta key in iTerm):

bind-key -n M-Up select-pane -U

I’m not sure if tmux provides a way to use the command key, but it might be possible to bind Command+ to send some other key sequence in your iTerm profile’s key settings, and then bind that key sequence in your tmux config.

Hope that helps!

@georgebrock

Thanks for the info!