Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
May the source be with you, but remember the KISS principle ;-)


News Classic Unix Utilities Recommended Links GNU Screen    
Command line options Splitting screen horizontally Detach Splitting screen horizontally Attaching to and detaching from screen sessions  GNU Screen logging
Teraterm The Quick GNU Screen Reference Card bash Tips and Tricks Unix Sysadmin Tips SSH Tips SCP Tips
AWK Tips AWK one liners GNU Screen Tips VIM VIM Tips VNC
OFM Orthodox Editors Admin Horror Stories Tips History of GNU Screen development Etc

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

tmux uses a client-server model. The server holds multiple sessions and each window is a independent entity which may be freely linked to multiple sessions, moved between sessions and otherwise manipulated. Each session may be attached to (display and accept keyboard input from) multiple clients.

tmux is intended to be a modern, BSD-licensed alternative to programs such as GNU screen. Major features include:

tmux is part of the OpenBSD base system. The portable version is hosted on SourceForge and runs on Linux, FreeBSD, NetBSD, Solaris and AIX.

tmux depends on libevent 1.4 and a terminfo implementation (normally ncurses).

Interview with Nicholas Marriott on tmux

We recently reported on the fact that tmux was imported into OpenBSD. By now, several changes have gone into the tree, including new features and some fixes from other developers. We spoke with Nicholas Marriott about tmux and his ideas for the future.

OpenBSD Journal: Why did you write tmux when there is well known screen ? Were you a heavy screen user before tmux ? Did it frustrate you into writing tmux ?

nicm@: I was a heavy screen user and I was vaguely unhappy with it. It was another of those programs with a lot of baggage - poor documentation, a strange configuration file and an unintuitive command-line interface. And that isn't mentioning the code.

There were a few things I wanted. In particular, being able to share a single window between multiple terminals, with other windows in the same session but entirely separate. Adding this to screen was implausible; it became one of my goals to have a codebase that was readable and could be extended.

OJ: How long have you worked on it so far ?

nicm@: tmux began with a quick prototype (called "nscr") and a few basic functions. A few months later I started fleshing out the prototype out and published the first version online in late 2007.

Currently, tmux is pretty usable and stable; I think most users could switch from tmux to screen or vice versa without missing too many features from either. There are still many feature requests and a lot of work to be done so I encourage everyone to read the code and send me their patches!

OJ: Can you tell us about how/when tmux got into base and you got your account ?

nicm@: It wasn't something I had expected. Paul Irofti [pirofti@] brought tmux up at the last hackathon and they decided to import it. Theo asked me for my opinion and I preferred to work on it in base: I felt tmux would be improved by being part of OpenBSD, it would add many more expert users and developers, a larger userbase, and a more rigorous development schedule - not to mention being more useful and easier to use than window(1).

OJ: Are you striving for full feature completeness compared to screen ? What screen features are you missing that you still want to add, which will you never add and what does tmux do that screen doesn't ?

nicm@: I don't like to sound like a politician, but that is a difficult question and the answer is "yes and no". I'd like for most people to be able to achieve the same things they can in screen in tmux. But tmux is not intended to be a copy of screen, and it should not behave as screen or have screen features just because screen has them.

At the moment, tmux has most of the major features of screen, but some things are missing - mostly things I didn't use. ;-)

If anyone is feeling itchy, here are a few items from my todo list:

If anyone has more, or has questions, let me know. :-)

OJ: Did the integration into OpenBSD base change anything for you and / or your development process ?

nicm@: Import into OpenBSD has been a good thing: I have received many feature requests, bug reports and code changes. I have to do a bit of work to sync up to make portable releases but tmux was already very portable and cvsps makes the job pretty easy so far.

OJ: What are your future plans for tmux ? What's next on your todo list ?

nicm@: There is a lot of work to be done in many areas, just look at the todo list.

At the moment I'm working on improving the layout code so that it is possible to split both vertically and horizontally. This will make layouts become "layout sets" which you can apply and then adjust.

I think it is pretty awesome and I have about 90% of it complete. Some of it is being tested now, and I hope to finish the whole thing within the next week or so.

Once that is done I'm not sure what I'll look at next. I have some ideas about adding hooks so you can execute commands on certain events (new window created, terminal resized, etc) but I haven't really thought that through too much. I might just spend some time trying to blitz the todo list and my inbox into manageable state. ;-)

Plus at the moment I spend time implementing smaller feature requests and fixing the odd bug.

OJ: Will you be working on other stuff in OpenBSD ? If so, what ?

nicm@: I don't know; I'd like to. At the moment tmux takes most of my time, but it has interested me in related areas such as terminal emulation and ncurses, so I might take a look at what I can do there.

OJ: Thank you, Nicholas, for your time in answering these questions and thanks for a very useful tool.

All in all, tmux is a very nice alternative to screen and it has the great benefit of being in base as of OpenBSD 4.6. If you're still on an older version and want to try out tmux, you can install the package or install a recent snapshot.

A tmux Crash Course

A tmux Crash Course

I’ve been using tmux for about six months now and it has become just as essential to my workflow as vim. Pane and window management, copy-mode for navigating output, and session management make it a no-brainer for those who live in the terminal (and especially vim). I’ve compiled a list of tmux commands I use daily to help me work more efficiently.


If a tmux command I mention is bound to a keyboard shortcut by default, I'll note that in parenthesis.

They're accessed by entering a key combination called the prefix and then typing a letter.

For example, if you see prefix + d below, that means you would first hit (and release) Control + b and then type d.

The prefix can also be changed, which I'll show you how to do later.

Session Management

Sessions are useful for completely separating work environments. I have a 'Work' session and a 'Play' session;

  • in 'Work', I keep everything open that I need during my day-to-day development,
  • while in 'Play', I keep open current open-source gems or other work I hack on at home.
tmux new -s session_name
creates a new tmux session named session_name
tmux attach -t session_name
attaches to an existing tmux session named session_name
tmux switch -t session_name
switches to an existing session named session_name
tmux list-sessions
lists existing tmux sessions
tmux detach (prefix + d)
detach the currently attached session


tmux has a tabbed interface, but it calls its tabs "Windows". To stay organized, I rename all the windows I use; if I'm hacking on a gem, I'll name the window that gem's name. The same thing goes for client applications. That way, I can recognize windows by context and not what application it's running.

tmux new-window (prefix + c)
create a new window
tmux select-window -t :0-9 (prefix + 0-9)
move to the window based on index
tmux rename-window (prefix + ,)
rename the current window


Panes take my development time from bland to awesome. They're the reason I was able to uninstall MacVim and develop solely in iTerm2. I don't have to switch applications to switch contexts (editing, reading logs, IRB, etc.) - everything I do, I do in a terminal now. People argue that OS X's Cmd+Tab is just as fast, but I don't think so.

tmux split-window (prefix + ")
splits the window into two vertical panes
tmux split-window -h (prefix + %)
splits the window into two horizontal panes
tmux swap-pane -[UDLR] (prefix + { or })
swaps pane with another in the specified direction
tmux select-pane -[UDLR]
selects the next pane in the specified direction
tmux select-pane -t :.+
selects the next pane in numerical order

Helpful tmux commands

tmux list-keys
lists out every bound key and the tmux command it runs
tmux list-commands
lists out every tmux command and its arguments
tmux info
lists out every session, window, pane, its pid, etc.
tmux source-file ~/.tmux.conf
reloads the current tmux configuration (based on a default tmux config)


These are some of my must-haves in my tmux config:

# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf

# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+


During the day, I'll work on one or two Rails apps, work on my dotfiles, run irssi, and maybe run vim in another window to take notes for myself. As I mentioned, I run all of this inside one tmux session (named work) and switch between the different windows throughout the day.

When I'm working on any Ruby work specifically, I'll have a 75%/25% vertical split for vim and a terminal so I can run tests, interact with git, and code. If I run tests or git diff and want to see more output than the 25% allots me, I'll use tmux to swap the panes and then move into copy mode to see whatever I need to see.

Finally, I run iTerm2 in full-screen mode. Switching between OS X apps for an editor and a terminal is for chumps!

What's next

If you found this article useful, you might also enjoy:

Top Visited
Past week
Past month


Old News ;-)

TMUX – The Terminal Multiplexer (Part 1)

See also TMUX – The Terminal Multiplexer (Part 2) Hawk Host Blog

TMUX – The Terminal Multiplexer (Part 2) Hawk Host Blog

tmux, a BSD alternative to GNU Screen Niall's Weblog

I started using tmux today. Its a terminal multiplexer / task switcher for UNIX-likes, very much in the same vein as GNU Screen. However, its a from-scratch implementation, designed to be clean, sane and easy to configure. The more liberal 3-clause BSD license is a plus also, since it means that OpenBSD has been able to integrate it into the source tree, so that its available out of the box.

Comparison with GNU Screen

I've been a heavy screen user for many years – almost all my work is done on remote screen sessions. However, screen configuration has always been essentially black magic to me. For this reason, tmux and its nice manual page is a breath of fresh air. `tmux list-commands' is very straight forward and easy to grok. Furthermore, I like that everything in tmux is scriptable from the command line – you can run commands like `tmux resize-pane-up -t comms' to resize the pane on a session called 'comms'.

The other thing I really like about tmux is its default status bar. Some people might hate this, but I find it very useful to have a clock and a list of windows along with the process executing in them. This took quite some work to set up to my liking in GNU screen, but the default in tmux is great.

switching from gnu screen to tmux (updated) Linux~ized

# ` is an interesting key for a prefix
set-option -g prefix `
# set-option -g prefix C-a

unbind-key C-b
bind-key C-a last-window
bind-key ` last-window
bind-key a send-prefix

# we might need ` at some point, allow switching
# we can also send the prefix char with `-a
bind-key F11 set-option -g prefix C-a
bind-key F12 set-option -g prefix `

# 0 is too far from `
set -g base-index 1

# set-option -g default-terminal "screen-256color"
set-option -g mouse-select-pane on
set-option -g status-keys vi
set-option -g bell-action any
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not)
set-option -g visual-bell on

setw -g mode-keys vi
setw -g mode-mouse on
setw -g monitor-activity on

bind e previous-window
bind f next-window
bind j up-pane
bind k down-pane

set-option -g status-utf8 on
# set-option -g status-justify centre
set-option -g status-justify left
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left-length 40

set-option -g pane-active-border-fg green
set-option -g pane-active-border-bg black
set-option -g pane-border-fg white
set-option -g pane-border-bg black

set-option -g message-fg black
set-option -g message-bg green

#setw -g mode-bg black

setw -g window-status-bg black
setw -g window-status-current-fg green
setw -g window-status-alert-attr default
setw -g window-status-alert-fg yellow

set -g status-left '#[fg=red]#H#[fg=green]:#[fg=white]#S #[fg=green]][#[default]'

# set -g status-right '#[fg=green]][#[fg=white] #T #[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]'
set -g status-right '#[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]'

set -g history-limit 4096

# `+r reloads the configuration, handy
bind r source-file ~/.tmux.conf

tmux: a replacement for gnu screen (updated)

Published on March 29, 2010 in UNIX tools and UNIX/Linux.

I have recently discovered tmux, a replacement for the slightly aging gnu screen. The so called "terminal multiplexer" allows to open several terminals inside the same terminal window. Much like gnu screen, you can split the screen, resize the different parts etc. However, tmux allow the usage of 256 color terminals and is based upon a client server infrastructure. And before you ask, like screen, it will stay alive and run your favorite app until you reconnect to the session.

It is part of the OpenBSD base distribution but will compile and run on a number of OS including Linux. Solaris, AIX, etc.

Update: for Mac OS users, it is available from macports.

Recommended Links

Google matched content

Softpanorama Recommended

Top articles


tmux - Wikipedia

tmux - ArchWiki

Tmux Cheat Sheet & Quick Reference




tmux(1) - Linux manual page



Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy


War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes


Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law


Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least

Copyright © 1996-2018 by Dr. Nikolai Bezroukov. was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.


FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case is down you can use the at


The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: November, 06, 2017