jasonwryan.com

Miscellaneous ephemera…

Sessions in tmux

Sessions in tmux

Now that I have been using it for several months, I have become absolutely dependent upon tmux, the terminal multiplexer. It is both ruthlessly efficient, and can be configured to match exacting requirements. One of those options is to initialize sessions with a preloaded window configuration. After reading the man page (which, truth be told, could be a little clearer) and some experimentation, I have worked out how to set up my tmux sessions how I want them. I have just updated the Arch Wiki tmux entry, so thought I would share it here.

The relevant part of my config file looks like this:

1
2
3
4
5
6
7
# session initialization
new  -n TTYtter /home/jason/Scripts/ttytter.pl
neww -n irssi /home/jason/Scripts/startirssi.sh
neww -n ncmpcpp/vifm ncmpcpp
splitw -v -p 50 -t 0 vifm
neww -n bash bash
selectw -t 1

Which, when I start tmux with the attach (or a) option, gives me the following window layout:

  • TTYtter
  • irssi
  • ncmpcpp/vifm     # window split vertically in half, ncmpcpp on top of vifm
  • bash

The selectw option means that the default view is TTYtter.

Simple.

Comments