Skip to content

Instantly share code, notes, and snippets.

@zlalanne
Last active February 3, 2023 23:33
Show Gist options
  • Save zlalanne/8188248 to your computer and use it in GitHub Desktop.
Save zlalanne/8188248 to your computer and use it in GitHub Desktop.
tmux on Cygwin

Steps to install tmux in Cygwin

Install required Cygwin packages

  1. run Cygwin setup.exe
  2. install these packages that are not installed by default: automake, gcc, git and pkg-config

Install libevent

  1. browse http://libevent.org
  2. download libevent-2.0.21-stable.tar.gz
  3. open a cygwin terminal
  4. cd to directory containing downloaded file
  5. tar zxf libevent-2.0.21-stable.tar.gz
  6. cd libevent-2.0.21-stable
  7. ./configure --prefix=/usr
  8. make && make install

Install ncurses

  1. browse http://ftp.gnu.org/gnu/ncurses
  2. download ncurses-5.9.tar.gz
  3. open a cygwin terminal
  4. cd to directory containing downloaded file
  5. tar zxf ncurses-5.9.tar.gz
  6. cd ncurses-5.9
  7. ./configure --prefix=/usr
  8. make && make install

Install tmux

  1. open a cygwin terminal
  2. git clone http://git.code.sf.net/p/tmux/tmux-code tmux-tmux-code
  3. cd tmux-tmux-code
  4. ./autogen.sh (will see many warnings; if it complains about \r not found, convert autogen.sh to use Unix line endings with mv autogen.sh temp.sh; dos2unix -o autogen.sh temp.sh)
  5. CFLAGS="-I/usr/include/ncurses" ./configure --prefix=/usr
  6. make && make install

Configure Cygwin and tmux

  1. to use the Solarized color scheme, see here.
  2. to manually adjust colors, fonts, cursor shape, and more right-click the Cygwin title bar and select "Options...".
  3. create a .tmux.conf file include at least this line so the mouse and arrow keys can be used to switch panes:
  4. set -sg escape-time 250
  5. for more information about tmux configuration, see here.

Run tmux

  1. open a cygwin terminal using mintty (the shortcut that opens the terminal should run C:\cygwin\bin\mintty.exe)
  2. tmux
@norbix
Copy link

norbix commented Oct 16, 2016

When compiling tmux itself I got below error.
...
/home/jakubczn/tmuxIDE/tmux-tmux-code/alerts.c:149:(.text+0x569): relocation truncated to fit: R_X86_64_PC32 against undefined symbol timerclear' names.o: In functioncheck_window_name':
/home/jakubczn/tmuxIDE/tmux-tmux-code/names.c:80: undefined reference to timerclear' /home/jakubczn/tmuxIDE/tmux-tmux-code/names.c:80:(.text+0xf4): relocation truncated to fit: R_X86_64_PC32 against undefined symboltimerclear'
session.o: In function session_update_activity': /home/jakubczn/tmuxIDE/tmux-tmux-code/session.c:284: undefined reference totimerclear'
/home/jakubczn/tmuxIDE/tmux-tmux-code/session.c:284:(.text+0x11fe): relocation truncated to fit: R_X86_64_PC32 against undefined symbol

timerclear' status.o: In functionstatus_timer_callback':
/home/jakubczn/tmuxIDE/tmux-tmux-code/status.c:162: undefined reference to timerclear' /home/jakubczn/tmuxIDE/tmux-tmux-code/status.c:162:(.text+0x169): relocation truncated to fit: R_X86_64_PC32 against undefined symboltimerclear'
tty-term.o:tty-term.c:(.rdata$.refptr.cur_term[.refptr.cur_term]+0x0): undefined reference to `cur_term'
collect2: error: ld returned 1 exit status
Makefile:704: recipe for target 'tmux.exe' failed
make: *** [tmux.exe] Error 1

Any Idea why ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment