From a899e855ec1c20aa952419bfc27b92b78ba02fe6 Mon Sep 17 00:00:00 2001 From: Tomohiko Himura Date: Mon, 19 Oct 2015 22:11:17 +0900 Subject: [PATCH] Fix open_command inside tmux --- lib/functions.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index efb73a1bd..61d402a09 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -17,6 +17,7 @@ function take() { function open_command() { local open_cmd + local nohup # define the open command case "$OSTYPE" in @@ -28,7 +29,14 @@ function open_command() { ;; esac - nohup $open_cmd "$@" &>/dev/null + # Use nohup command + if [ ${TMUX:-NOT_USE_TMUX} = "NOT_USE_TMUX" ]; then + nohup="nohup" + else + nohup="" + fi + + $nohup $open_cmd "$@" &>/dev/null } #