Skip to content

fix(installer): make PAI-Install headless-safe on Linux#1081

Open
renoirb wants to merge 1 commit intodanielmiessler:mainfrom
renoirb:fix/headless-install-set-u-and-gui-default
Open

fix(installer): make PAI-Install headless-safe on Linux#1081
renoirb wants to merge 1 commit intodanielmiessler:mainfrom
renoirb:fix/headless-install-set-u-and-gui-default

Conversation

@renoirb
Copy link
Copy Markdown

@renoirb renoirb commented Apr 16, 2026

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant