diff --git a/CHANGELOG.md b/CHANGELOG.md index 8168c35..73ae4fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### master +- bugfix: prevent exiting tmux if 'reattach-to-user-namespace' is not installed ### v1.1.0, 2014-08-30 - bugfix: determine the default shell from the $SHELL env var on OS X diff --git a/sensible.tmux b/sensible.tmux index aa5344b..a834e7a 100755 --- a/sensible.tmux +++ b/sensible.tmux @@ -7,6 +7,11 @@ is_osx() { [ "$platform" == "Darwin" ] } +command_exists() { + local command="$1" + type "$command" >/dev/null 2>&1 +} + # returns prefix key, e.g. 'C-a' prefix() { tmux show-option -gv prefix @@ -82,7 +87,7 @@ main() { fi # required (only) on OS X - if is_osx && option_value_not_changed "default-command" ""; then + if is_osx && command_exists "reattach-to-user-namespace" && option_value_not_changed "default-command" ""; then tmux set-option -g default-command "reattach-to-user-namespace -l $SHELL" fi