aboutsummaryrefslogtreecommitdiff
path: root/internal/worker.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'internal/worker.zsh')
-rw-r--r--internal/worker.zsh8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/worker.zsh b/internal/worker.zsh
index 8eb21af3..269e8aad 100644
--- a/internal/worker.zsh
+++ b/internal/worker.zsh
@@ -181,7 +181,13 @@ function _p9k_worker_start() {
setopt monitor || return
{
[[ -n $_p9k__worker_resp_fd ]] && return
- _p9k__worker_file_prefix=${TMPDIR:-/tmp}/p10k.worker.$EUID.$sysparams[pid].$EPOCHSECONDS
+
+ if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
+ local tmpdir=$TMPDIR
+ else
+ local tmpdir=/tmp
+ fi
+ _p9k__worker_file_prefix=$tmpdir/p10k.worker.$EUID.$sysparams[pid].$EPOCHSECONDS
sysopen -r -o cloexec -u _p9k__worker_resp_fd <(
exec 0</dev/null