add check for reattach-to-user-namespace

if reattach-to-user-name-space exists, run it, otherwise just run the shell

* create login-shell command to perform this check
* update tmux.conf to run login-shell instead of reattach-to-user-namespace directly
This commit is contained in:
Nick Nisi
2016-04-17 08:51:49 -05:00
parent f42f2d16ec
commit b117a18b7a
2 changed files with 11 additions and 1 deletions

10
bin/login-shell Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
shell=$(basename "$SHELL")
# check if reattach-to-user-namespace is available
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
reattach-to-user-namespace -l "$shell"
else
exec "$shell -l"
fi

View File

@@ -1,4 +1,4 @@
set -g default-command "reattach-to-user-namespace -l zsh" set -g default-command "login-shell"
# tmux display things in 256 colors # tmux display things in 256 colors
set -g default-terminal "tmux-256color-italic" set -g default-terminal "tmux-256color-italic"
set -g status-utf8 on set -g status-utf8 on