Skip to content

fix: use $HOME instead of ~ in preamble for Windows compatibility#558

Open
HMAKT99 wants to merge 2 commits intogarrytan:mainfrom
HMAKT99:arun/fix-windows-preamble-paths
Open

fix: use $HOME instead of ~ in preamble for Windows compatibility#558
HMAKT99 wants to merge 2 commits intogarrytan:mainfrom
HMAKT99:arun/fix-windows-preamble-paths

Conversation

@HMAKT99
Copy link
Copy Markdown
Contributor

@HMAKT99 HMAKT99 commented Mar 27, 2026

Summary

  • replace bare ~/.gstack/ with "$HOME/.gstack/" in all preamble bash blocks
  • affects marker file checks, touch, mkdir, find, and analytics appends
  • update zsh-safe glob test to match new path format
  • prose/documentation references left as ~/.gstack/

Problem

Every gstack skill invocation on Windows re-prompts the user to read the "Boil the Lake" essay, re-asks about telemetry consent, and re-asks about proactive mode — even after the user already answered.

The preamble checks marker files with bare ~:

_LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")

Tilde expansion is not guaranteed in all Windows shell contexts (Git Bash subshells, MSYS2, CI runners). When ~ doesn't expand, the [ -f check always returns false and the marker is never found.

Reproduction

  1. Windows 10/11 with Git Bash
  2. Run any gstack skill (e.g. /office-hours)
  3. Answer the Boil the Lake, telemetry, and proactive prompts
  4. Run another gstack skill
  5. All three prompts appear again

Root Cause

touch ~/.gstack/.completeness-intro-seen creates the file at a literal ~/.gstack/ path (or fails silently). The next invocation checks [ -f ~/.gstack/.completeness-intro-seen ] which also fails to expand ~. The marker is never written or never found.

Fix

Replace ~ with "$HOME" in all 15 executable bash paths in scripts/resolvers/preamble.ts. $HOME is set by the OS on every platform and expands reliably in all bash contexts.

Updated paths:

  • mkdir -p, touch, find for sessions directory
  • [ -f ... ] checks for .completeness-intro-seen, .telemetry-prompted, .proactive-prompted
  • >> ... skill-usage.jsonl and eureka.jsonl appends
  • rm -f ... .pending-* cleanup

Verification

bun run gen:skill-docs --dry-run
  29 FRESH, 0 STALE

bun test test/skill-validation.test.ts test/gen-skill-docs.test.ts
  563 pass, 1 fail (pre-existing: package.json version mismatch on main)

Fixes #475.

HMAKT99 and others added 2 commits March 27, 2026 10:49
The preamble bash block used bare ~ for all .gstack/ paths:
  [ -f ~/.gstack/.completeness-intro-seen ]
  touch ~/.gstack/.completeness-intro-seen
  mkdir -p ~/.gstack/sessions

Tilde expansion is not guaranteed in all Windows shell contexts
(Git Bash subshells, MSYS2, CI runners). When ~ doesn't expand,
the marker file check always returns false and every skill
invocation re-prompts the user to read the "Boil the Lake" essay.

Fix: replace all bare ~/.gstack/ paths with "$HOME/.gstack/" in
executable bash blocks. Prose/documentation references left as-is.
Update the zsh-safe glob test to match the new $HOME path.

Fixes garrytan#475.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (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.

GStack’s persistence of user reading “Boil the Lake” essay is not cross-platform compatible

1 participant