Bugfix: tmux quits if 'reattach-to-user-namespace' is not installed

Fixes #9
pull/13/head
Bruno Sutic 2014-09-21 16:01:00 +02:00
parent 9beab4784c
commit c908b42f2b
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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