diff --git a/bin/login-shell b/bin/login-shell new file mode 100755 index 0000000..2e6b52c --- /dev/null +++ b/bin/login-shell @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +# Ensure that tmux windows are by default named after the shell, rather than +# full path to the shell binary. +shell=$(basename "$SHELL") + +# If reattach-to-user-namespace is not available, just run the command. +if [ -n "$(command -v reattach-to-user-namespace)" ]; then + reattach-to-user-namespace -l "$shell" +else + exec "$shell" +fi diff --git a/tmux.conf b/tmux.conf index 98a786c..56b3647 100644 --- a/tmux.conf +++ b/tmux.conf @@ -13,7 +13,7 @@ set -g mouse-select-window on set -g history-limit 10240 # Mac OS X fix for pbcopy, pbpaste, and launchctl -set-option -g default-command "safe-reattach-to-user-namespace -l $SHELL" +set-option -g default-command "login-shell" # Load Theme source-file "${HOME}/.tmux/themes/powerline-block-green.tmuxtheme"