From c1fe41786bbbd468b4ef117d4e592e4fee28fc0b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 14 Jul 2011 17:17:34 -0400 Subject: [PATCH] Fixed GNU Screen and tmux configuration file detection. --- functions/alias.zsh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/functions/alias.zsh b/functions/alias.zsh index 03850ead..2cbe9ad9 100644 --- a/functions/alias.zsh +++ b/functions/alias.zsh @@ -82,19 +82,16 @@ fi # Terminal Multiplexer # ------------------------------------------------------------------------------ -local screenrc tmuxconf -if [[ "$TERM" == 'xterm-color' ]]; then - if [[ -e "$HOME/.screenrc" ]]; then - screenrc="-c '$HOME/.screenrc'" - tmuxconf="-f '$HOME/.tmux.conf'" - fi -fi - -if [[ "$TERM" == 'xterm-256color' ]]; then +if [[ "$TERM" == *256color* ]]; then if [[ -e "$HOME/.screenrc256" ]]; then screenrc="-c '$HOME/.screenrc256'" tmuxconf="-f '$HOME/.tmux256.conf'" fi +else + if [[ -e "$HOME/.screenrc" ]]; then + screenrc="-c '$HOME/.screenrc'" + tmuxconf="-f '$HOME/.tmux.conf'" + fi fi alias screen="screen $screenrc" @@ -102,6 +99,8 @@ alias sl="screen $screenrc -list" alias sr="screen $screenrc -a -A -U -D -R" alias S="screen $screenrc -U -S" -alias tmux="tmux $tmuxconf" -alias tls="tmux list-sessions" +if (( ${+commands[tmux]} )); then + alias tmux="tmux $tmuxconf" + alias tls="tmux list-sessions" +fi