Skip to content

Commit

Permalink
need to use reattach-to-user-namespace
Browse files Browse the repository at this point in the history
otherwise shell commands hang inside tmux/byobu/etc

work around julienXX/terminal-notifier#115
  • Loading branch information
srl295 committed Jan 6, 2017
1 parent e01c934 commit e584dd5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion extensions/10-preexec
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
if command -v terminal-notifier 2>&1 >/dev/null; then

# https://github.com/julienXX/terminal-notifier/issues/115
reattach_cmd=""
if command -v reattach-to-user-namespace 2>&1 >/dev/null; then
reattach_cmd="reattach-to-user-namespace"
fi

preexec_time="0"

preexec() {
Expand All @@ -23,7 +29,7 @@ if command -v terminal-notifier 2>&1 >/dev/null; then
notify="0"
fi
if [ $notify -eq "1" ]; then
terminal-notifier -message "$preexec_cmd" -title "Completed after ${diff} seconds"
"$reattach_cmd" terminal-notifier -message "$preexec_cmd" -title "Completed after ${diff} seconds"
fi
}

Expand Down

0 comments on commit e584dd5

Please sign in to comment.