File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -587,6 +587,20 @@ if [ -x "\$APPIMAGE" ]; then
587587 # emit "open dir error: No such file or directory" on Linux.
588588 cd "\$ HOME" 2>/dev/null || cd / 2>/dev/null || true
589589
590+ # AppImage can also fail with the same error when inherited runtime/temp
591+ # dirs point to deleted paths (common after terminal multiplexers/shells
592+ # survive logouts or tmp cleanup). Sanitize them before exec.
593+ if [ -n "\$ {XDG_RUNTIME_DIR-}" ] && [ ! -d "\$ XDG_RUNTIME_DIR" ]; then
594+ unset XDG_RUNTIME_DIR
595+ fi
596+ PAIRUX_TMP_DIR="\$ HOME/.pairux/tmp"
597+ mkdir -p "\$ PAIRUX_TMP_DIR" 2>/dev/null || true
598+ if [ -d "\$ PAIRUX_TMP_DIR" ] && [ -w "\$ PAIRUX_TMP_DIR" ]; then
599+ export TMPDIR="\$ PAIRUX_TMP_DIR"
600+ elif [ -z "\$ {TMPDIR-}" ] || [ ! -d "\$ TMPDIR" ] || [ ! -w "\$ TMPDIR" ]; then
601+ export TMPDIR="/tmp"
602+ fi
603+
590604 # If FUSE is unavailable or inaccessible (common in restricted/containerized
591605 # environments), fall back to extract-and-run mode so the AppImage can still
592606 # launch. A simple -r/-w check is not enough because /dev/fuse may exist but
You can’t perform that action at this time.
0 commit comments