Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Mouse support - set to on if you want to use the mouse
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUXVER=1.9
LOCALPATH=$HOME/tmux_tmp/local
# create our directories
mkdir -p $LOCALPATH
cd $HOME/tmux_tmp
# download source files for tmux, libevent, and ncurses
wget -O tmux-$TMUXVER.tar.gz http://sourceforge.net/projects/tmux/files/tmux/tmux-$TMUXVER/tmux-$TMUXVER.tar.gz/download
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
# extract files, configure, and compile
############
# libevent #
############
tar xvzf libevent-2.0.19-stable.tar.gz
cd libevent-2.0.19-stable
./configure --prefix=$LOCALPATH --disable-shared
make
make install
cd ..
############
# ncurses #
############
tar xvzf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=$LOCALPATH --with-default-terminfo-dir=/usr/share/terminfo --with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo"
make
make install
cd ..
############
# tmux #
############
tar xvzf tmux-1.9.tar.gz
cd tmux-1.9
./configure --enable-static CFLAGS="-I$LOCALPATH/include -I$LOCALPATH/include/ncurses" LDFLAGS="-static -static-libgcc -L$LOCALPATH/lib -L$$LOCALPATH/include/ncurses -L$LOCALPATH/include"
CPPFLAGS="-I$LOCALPATH/include -I$LOCALPATH/include/ncurses" LDFLAGS="-static -static-libgcc -L$LOCALPATH/include -L$LOCALPATH/include/ncurses -L$LOCALPATH/lib" make
############
# install #
############
mkdir -p $HOME/bin
cp tmux $HOME/bin
cd $HOME
# cleanup
rm -rf $HOME/tmux_tmp
echo "$HOME/bin/tmux is now available. You can optionally add $HOME/bin to your PATH."
@apokalyptik

This comment has been minimized.

Copy link
Owner Author

commented Jun 8, 2015

Prebuilt binary download link (works on sandboxes at work)

http://blog.apokalyptik.com/wp-content/uploads/tmux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.