From 735d3dac4da56095da60446891e3da011a87491f Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Sat, 22 Oct 2016 21:39:28 +1100 Subject: [PATCH] Properly handle zsh init when $TMPDIR and/or $USER aren't available in the environment --- zshenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshenv b/zshenv index b8c89f7..8d54939 100644 --- a/zshenv +++ b/zshenv @@ -7,7 +7,7 @@ # destroyed when the user logs out but close enough. The reason for suffixing # /xdg-$USER is that TMPDIR does not necessarily belong to the current user # exclusively (although it does under MacOS and PAM). -[[ -z $XDG_RUNTIME_DIR ]] && XDG_RUNTIME_DIR=${TMPDIR%/}/xdg-$USER +[[ -z $XDG_RUNTIME_DIR ]] && XDG_RUNTIME_DIR=${${TMPDIR-/tmp}%/}/xdg-$LOGNAME [[ -d $XDG_RUNTIME_DIR ]] || mkdir -p $XDG_RUNTIME_DIR export XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME XDG_RUNTIME_DIR