]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh/rc: Check if the multiplexer is available.
authorSimon Ruderich <simon@ruderich.org>
Mon, 16 Sep 2013 21:46:12 +0000 (23:46 +0200)
committerSimon Ruderich <simon@ruderich.org>
Mon, 16 Sep 2013 21:46:43 +0000 (23:46 +0200)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 8b5a333ccdbbf066c53f68bc5a69e96c31612c6b..6b646b5a42ccec8a8bdbb2e55e6ea5e23ec3530a 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -853,6 +853,15 @@ source_config ~/.zsh/rc.local
 
 # RUN COMMANDS
 
+# Make sure the multiplexer is available. Otherwise the exec terminates our
+# session.
+if [[ -n $zshrc_use_multiplexer ]]; then
+    if ! (( $+commands[$zshrc_use_multiplexer] )); then
+        echo "Multiplexer '$zshrc_use_multiplexer' not found." >&2
+        zshrc_use_multiplexer=
+    fi
+fi
+
 # If not already in screen or tmux, reattach to a running session or create a
 # new one. This also starts screen/tmux on a remote server when connecting
 # through ssh.