Browse files

Refining readme file with tmux launch setup

  • Loading branch information...
1 parent 49f9212 commit 32aed11a90fd5cd9e8ef7afea68324fd38cd197b @danclaudiupop committed Sep 19, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 README.rst
View
14 README.rst
@@ -5,3 +5,17 @@ Install
To install or update run::
wget -qO- https://github.com/danclaudiupop/dotfiles/raw/master/install.sh | /bin/bash
+
+To launch tmux by default add the following lines in bashrc::
+
+ if [[ "$TERM" != "screen-256color" ]]
+ then
+ tmux -2 attach-session -t "$USER" || tmux -2 new-session -s "$USER"
+ exit
+ fi
+
+Now to break down what exactly the above lines do:
+
+- if [ $TERM != "screen-256color" ] && [ $TERM != "screen" ];, this checks the $TERM environment variable to see if tmux is already running. This is to avoid an infinite loop of launching tmux.
+- tmux attach || tmux new; exit, this launches tmux and attaches to a running session or creates a new one.
+- exit, this closes the shell running underneath tmux when the last tmux window is closed.

0 comments on commit 32aed11

Please sign in to comment.