Introduction

What is Tmux and Why Do I Need It?

In a day and age where monitors are huge and processors are powerful it doesn’t make sense that we’re limited to a single command line interface per terminal session. Tmux is a way to fix that. When you’re using tmux you’re in charge of an endless army of terminals that you can use to monitor and command all aspects of your work from a single window. So you can monitor output from your server while you write new code, run your compilation scripts, and do it all while looking like the world’s most über häcker. If you spend more than a minute or two a day on the command line you need to be using tmux, and the best part is that it’s pretty simple to get set up and comfortable.

What This Book Is

This book aims to be:

Short

You’ve got better things to do than read books about terminal multiplexers1. Tmux isn’t that hard, once you get into it, and I’ll keep this brief so you can get on with the important stuff you’re doing.

Cheap

tmux is free. While I don’t want to sell my work for nothing, I’m coming pretty darn close. This is a beginner’s book, and my goal is to lower the bar to entry. To start with, I’ll price it low and hope that helps you along.

Easy to understand

My main goal here is to help you build confidence and get your feet under you. If you’re reading this during the beta period and you’ve got suggestions, please send them on over to me! I’m more than willing to listen and change.

Friendly!

My high horse died a while back, and I never bothered to buy myself a soapbox, so I won’t be doing any preaching. I think tmux is an awesome way to be productive and look good doing it, and I want to help you have that same level of fun and power.

Opinionated (but in a good way)

I’ll keep the tone friendly, but I got opinions people. There are things I think are good and things I think aren’t so good. But I’ll let you know why I think some things are good or not so good and let you make up your mind on your own.

Lighthearted, but serious

The tone of the book is meant to be light and approachable, but the advice is meant to be rock solid. I’m not going to have you do things to your configuration files that I wouldn’t do, even temporarily, or to prove a point. The goal is to make it easy for you to get things right 2 the first time.

What This Book Isn’t

This book definitely is not:

The end-all-be-all reference on tmux

I’m here to help you get started, not to be the only book you’ll ever read on the subject. Tmux is actively changing, and once you get your feet under you it will be easy for you to adapt to those changes on your own. I’m here to help you spread your wings and fly, free and on your own. You can do it!

A list of tips

A lot of the stuff in the later chapters won’t make a ton of sense if you haven’t been through the earlier chapters. The chapters are laid out iteratively, starting with small changes that build up to a final configuration that should work well. Then you’ll have a good jumping-off point for your further experiments.

A deep dive

The goal here is to give you enough information to be comfortable, but not all the underlying technologies and line editor commands and other such things. Again, these are available online and in many other reference guides all over the place. When you decide that you want to know more about something you’ll be able to find it. I have faith in you.

Who am I?

I’m Nate Dickson, it says so right on the cover.

I’m also the author of Painless Vim, a book that seeks to make learning vim less terrible. Beyond that I’m a professional programmer by day, author, blogger, and daddy by night. You can check out a fairly large amount of my writing on my personal blog3, my sporadically maintained tech blog4, or my less-maintained Apple blog5. You can also check me out on Twitter6, Github7 and App.net8.

References

I will refer you to a lot of other books, posters, blogs, wikis, etc. etc. over the course of this book. For the most part these are things I’ve used extensively myself, and can heartily recommend. Again, I’ll try to provide reasons for my references and let you decide if it sounds like something you’d like to investigate on your own.

The Obligatory “Conventions Used in This Book” Section

First off, regarding the actual word “tmux”. In general I will write it all lowercase, because that’s how most people think of it, like “perl” or “ruby”. That’s the command you enter to start the editor, and that’s really the name of the program.

However, when it’s in a book, chapter, or section title I will capitalize it, just as I would any other word in a title: Painless Tmux.

Occasionally I’ll put in chapters called “Interludes”. These are chapters that are less intense than the regular ol’ chapters, and more focused on taking a look back over what we’ve already covered and crystalizing what we’ve learned. Think of them as nice places to sit down and reflect on how wise you are becoming.

Other than that, I use the same conventions everyone else uses. Code appears in a monospaced font, and longer blocks of code will appear

in a large block
of monospaced text.

Special keys like <shift>, <enter>, <esc> will have angle brackets around the name to make it real obvious that you shouldn’t be typing that word, you should be pressing that key. If you need to press <ctrl> and another key at the same time (and you will need to do this, quite frequently) I’ll just write them like so: <ctrl>b.

If you need to press keys in sequence I will put a space between the keys. So if you need to press g and then t I would type it like this:

g t

This will usually happen when you start off a command made up of two keys, and then press a third key:

<ctrl>b x

In this case you would press <ctrl> and b at the same time, then release them and press x.

Again, this will all make more sense in a bit. For now let’s get moving.