Gracefully handle launchctl failure, using reattach script if possible.
Documented here: http://stackoverflow.com/questions/10193561/tmux-socket-is-not-connected-error-on-os-x-lion
This commit is contained in:
parent
13b501adaf
commit
4361239a98
1 changed files with 5 additions and 1 deletions
|
@ -16,7 +16,11 @@
|
|||
# Set environment variables for launchd processes.
|
||||
if [[ "$OSTYPE" == darwin* ]]; then
|
||||
for env_var in PATH MANPATH; do
|
||||
launchctl setenv "$env_var" "${(P)env_var}"
|
||||
if which reattach-to-user-namespace > /dev/null; then
|
||||
reattach-to-user-namespace launchctl setenv "$env_var" "${(P)env_var}"
|
||||
else
|
||||
launchctl setenv "$env_var" "${(P)env_var}" || echo "Launchctl error, possible solution: Install reattach-to-user-namespace"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
} &!
|
||||
|
|
Loading…
Add table
Reference in a new issue