From 4361239a98fbeae1bcabd85d3cd62e6a14ded1f3 Mon Sep 17 00:00:00 2001 From: John McDonnell Date: Mon, 19 Nov 2012 21:47:26 -0500 Subject: [PATCH] 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 --- runcoms/zlogin | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runcoms/zlogin b/runcoms/zlogin index 9e315775..cfd74e4e 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -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 } &!