fix(installer): make PAI-Install headless-safe on Linux#1081
Open
renoirb wants to merge 1 commit intodanielmiessler:mainfrom
Open
fix(installer): make PAI-Install headless-safe on Linux#1081renoirb wants to merge 1 commit intodanielmiessler:mainfrom
renoirb wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
Two regressions prevented the installer from running on headless /
SSH Linux hosts (no X11/Wayland):
1. install.sh:158 — referenced bare $DISPLAY / $WAYLAND_DISPLAY under
`set -euo pipefail`. nounset aborted the script before the headless
fallback could run. Fixed by using ${DISPLAY:-} / ${WAYLAND_DISPLAY:-}.
Observed error: `install.sh: line 158: DISPLAY: unbound variable`.
2. main.ts:18 — mode defaulted to "gui" when --mode was omitted, so
running `bun PAI-Install/main.ts` directly bypassed install.sh's
headless detection and spawned Electron. Added a defaultMode() helper
that returns "cli" on non-Darwin hosts without DISPLAY/WAYLAND_DISPLAY.
Also fixes: `bun PAI-Install/main.ts` no longer tries to `npm install`
electron on hosts that can never run it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two regressions prevented the installer from running on headless / SSH Linux hosts (no X11/Wayland):
install.sh:158 — referenced bare $DISPLAY / $WAYLAND_DISPLAY under
set -euo pipefail. nounset aborted the script before the headless fallback could run. Fixed by using ${DISPLAY:-} / ${WAYLAND_DISPLAY:-}. Observed error:install.sh: line 158: DISPLAY: unbound variable.main.ts:18 — mode defaulted to "gui" when --mode was omitted, so running
bun PAI-Install/main.tsdirectly bypassed install.sh's headless detection and spawned Electron. Added a defaultMode() helper that returns "cli" on non-Darwin hosts without DISPLAY/WAYLAND_DISPLAY.Also fixes:
bun PAI-Install/main.tsno longer tries tonpm installelectron on hosts that can never run it.