Years ago I had finally picked up on using a terminal multiplexer as part of my day to day workflow. I started with tmux having only used screen for one off server tasks that I wanted to persist across my Internet connection taking a shit.

Nothing wrong with tmux but I had made the mistake of starting off with tmuxinator which tacks on some pretty solid session management onto tmux. This was all well and good but because I scripted my windows to be exactly where / how I wanted them, I ended up being shielded from truly learning how to use tmux.

To be more specific, I never actually wrapped my head around how tmux handles windows and panes versus how screen does.

And then I went off the rails decided to simplify my life by abandoning my over-dependence to package managers and plugins. This eventually led me down the path of dumping tmux all together and moving to screen as my daily driver.

The major contributing factor, which you will probably find laughable, is that I really didn’t like the default prefix key with tmux, CTRL-b.

I know it can be reconfigured, but if my first order of business is to reconfigure tmux to use the screen prefix, CTRL-a, which I find to feel more natural, that it makes a whole lot of sense to just use screen instead.

Fast forward a couple of years and I’m still using screen but felt it may be time to re-evaluate things and give tmux a shot without all of the cruft of tmuxinator and actually digging into learning how to really use tmux.

It also didn’t hurt that a buddy of mine was asking me if I remembered how to do something in tmux the other day.

Which sadly, I didn’t.

With that, to get more formally reacquainted with tmux, I put together a little comparison chart of the hotkeys in screen and tmux. Keep in mind, this is not an exhaustive list, it’s the stuff that I regularly use.

There’s also a hard bias towards vi-mode and key combinations that keep me closer to the home row or require the least amount of keystrokes.

Action GNU Screen Tmux
Start Named Session screen -S <name> tmux new -s <name>
List Sessions screen -ls tmux ls
Reconnect to Named Session screen -R <name> tmux attach -t <name>
Detach Session CTRL-a d CTRL-b d
Create New Window CTRL-a c CTRL-b c
Rename Window CTRL-a A CTRL-b ,
Jump to Last Active Window CTRL-a CTRL-a CTRL-b l
Jump to Window by Number CTRL-a <number> CTRL-b <number>
Jump to Next Window CTRL-a n CTRL-b n
Jump to Previous Window CTRL-a p CTRL-b p
Show Window List CTRL-a " CTRL-b w
Show Window Bar CTRL-a w n/a, on by default
Kill Current Window CTRL-a k CTRL-b &
Kill Session / All Windows CTRL-a \\ tmux kill-session
Split Horizontally CTRL-a | CTRL-b "
Split Vertically CTRL-a S CTRL-b %
Make Split Wider CTRL-a :resize -h <number> CTRL-b ALT-←
Make Split Thinner CTRL-a :resize -h <number> CTRL-b ALT-→
Make Split Taller CTRL-a :resize -v <number> CTRL-b ALT-↑
Make Split Shorter CTRL-a :resize -v <number> CTRL-b ALT-↓
Jump to Next Split CTRL-a TAB CTRL-b o
Jump to Previous Split CTRL-a SHIFT TAB Navigate with CTRL-b ← → ↑ ↓
Close Current Split CTRL-a X CTRL-b x
Close All but Current Split CTRL-a Q Couldn’t find this one
Enter Copy / Scrollback Mode CTRL-a [ CTRL-b [
Toggle Copy Selection SPACE SPACE
Jump Half Page Up CTRL-u CTRL-u
Jump Half Page Down CTRL-d CTRL-d
Jump Full Page Up CTRL-b CTRL-b CTRL-b
Jump Full Page Down CTRL-f CTRL-f
Jump To Top g g
Jump To Bottom G G
Move Cursor Left h h
Move Cursor Down j j
Move Cursor Up k k
Move Cursor Right l l
Copy ENTER ENTER
Paste CTRL-a ] CTRL-b ]
Exit Copy / Scrollback Mode q q

Real talk here, after sitting and messing with tmux a bit to work through these different hotkeys, I think I very well may hang up screen and plunge into tmux head first this new year!

Who the hell knows, maybe I’ll switch to nvim too ;)