Skip to content

fix: quote manual worktree navigation hints - #191

Merged
andyrewlee merged 3 commits into
mainfrom
advisor/013-quote-manual-navigation-hints
Sep 27, 2026
Merged

andyrewlee merged 3 commits into
mainfrom
advisor/013-quote-manual-navigation-hints

Conversation

@andyrewlee

Copy link
Copy Markdown
Owner

Summary

  • Plan 013: manual cd hints are shell-quoted (cd -- '<path>') and suppressed entirely for control-character paths; raw JSON and CD directives are unchanged.

Stacked on advisor/012-preserve-worktree-path-bytes. Part of the advisor/NNN plan series; merge in stack order.

Test plan

  • Repository CI gate (make ci) passed on this commit or an identical code tree (docs/design-only branches ran their validators + focused suites instead)
  • Reviewer: land bottom-up; GitHub retargets the next PR when this one merges

@andyrewlee
andyrewlee force-pushed the advisor/012-preserve-worktree-path-bytes branch from 1e470a4 to 449656c Compare September 26, 2026 12:11
@andyrewlee
andyrewlee force-pushed the advisor/013-quote-manual-navigation-hints branch from 9d1e503 to 142f4fb Compare September 26, 2026 12:11
@andyrewlee
andyrewlee force-pushed the advisor/012-preserve-worktree-path-bytes branch from 449656c to 5a8687e Compare September 27, 2026 02:22
@andyrewlee
andyrewlee changed the base branch from advisor/012-preserve-worktree-path-bytes to main September 27, 2026 02:42
The no-shim teleport hint printed 'run: cd <path>' with the raw path —
spaces pasted wrong, and metacharacters like ; or $(...) executed as
shell syntax when pasted.

Emit 'run: cd -- '<path>'' with POSIX single-quoting (the close-escape-
reopen idiom for embedded apostrophes), shared by the raw and
terminal-sanitized hint variants so they cannot drift. Paths containing
terminal control bytes get no executable suggestion — the escaped
spelling would not name the directory — only a pointer at the shell
integration or the --json worktree field. JSON path fields keep exact
bytes.
@andyrewlee
andyrewlee force-pushed the advisor/013-quote-manual-navigation-hints branch from 142f4fb to 8c0e350 Compare September 27, 2026 02:42
NTFS forbids ':' in directory names, so the injection-payload dirs can't
embed an absolute sentinel path; name PWNED relatively and run the probe
with Dir=base so a broken quote still lands touch where Stat looks. MSYS
bash prints /c/-style paths from `pwd -P`; use `pwd -W` on Windows and
compare slash-normalized case-insensitively.
@andyrewlee
andyrewlee merged commit 945b50d into main Sep 27, 2026
4 checks passed
@andyrewlee
andyrewlee deleted the advisor/013-quote-manual-navigation-hints branch September 27, 2026 02:59
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