Install Tmux in Cygwin

 03 Mar 2014

 0 Comments

Originally I had found this page describing how to install Tmux in cygwin and I was able to accomplish this goal with relative ease. Once I realized that the instructions were dead simple, and that ncurses and libevent appears to already be included in cygwin I wanted to give it another go where I only installed tmux itself from source.

I’m using the following alias with apt-cyg for the rest of this post:

alias cyg='apt-cyg -m http://mirrors.kernel.org/sources.redhat.com/cygwin/'

Then installing tmux was as simple as following this script:

# Dependencies
cyg install gcc-core make automake pkg-config libevent-devel ncurses libncursesw-devel

# Now install tmux, I did this in ~/src
git clone http://git.code.sf.net/p/tmux/tmux-code tmux
cd tmux
export INCLUDE_PATH=/usr/local/include/
export LIBRARY_PATH=/usr/local/lib/
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
./autogen.sh
./configure
make && make install

Now I have a working tmux!

Tmux

My config for this status bar was generated by a vim plugin and you can view my exact setup by looking at my main tmux config file, and the generated status bar config file.

The config for the vim plugin that generated this layout:

" Don't use airline colors
let g:airline#extensions#tmuxline#enabled = 0

" Colors
let g:tmuxline_theme = {
      \'a'   :["colour15","colour01","bold"],
      \'b'   :["colour15","colour11","bold"],
      \'c'   :["colour10","colour00","bold"],
      \'x'   :["colour10","colour00","bold"],
      \'y'   :["colour15","colour09","bold"],
      \'z'   :["colour15","colour04","bold"],
      \'win' :["colour10","colour00","bold"],
      \'cwin':["colour15","colour13","bold"],
      \'bg'  :["colour00","colour00"]
      \}

" Preset
let g:tmuxline_preset = {
      \ 'a': '#S',
      \ 'win' :'#I:#W #F',
      \ 'cwin':'#I:#W #F',
      \ 'x': '%F',
      \ 'y': '%R',
      \ 'z': '#H',
      \ 'options': {
      \   'status-justify': 'left',
      \   'message-fg': 'colour15',
      \   'message-bg': 'colour00',
      \   'message-attr': 'bold',
      \   'message-command-fg': 'colour15',
      \   'message-command-bg': 'colour01',
      \   'message-command-attr': 'bold' }
      \}