Repository navigation
fix(cli): quote the project name in init's printed cd commands - #7608
Merged
miguel-heygen merged 1 commit intoNov 14, 2026
Merged
Conversation
`hyperframes init --non-interactive` closes with `cd <name> && npm run …` lines for the person or agent to paste. The name went in as typed, so a name with a space or a quote printed a command that fails as written: `cd my first video` (bash: "cd: my: No such file or directory", zsh: "too many arguments") and `cd it's mine` (an unterminated quote). A new `shellArg` quotes a word only when a shell would split or expand it: double quotes, or single quotes when the text holds `$`, a backtick, `\`, `"` or `!`; on Windows, double quotes, with `\` paths left bare. `hyperframes open` / `preview --stop` hints (desktopApp's `shownDir`) already quoted whitespace with JSON.stringify and now use it too, so a name like `it's` or `a&b` is covered there as well. Co-Authored-By: Claude Opus 5.5 <[email protected]>
miguel-heygen
approved these changes
Nov 14, 2026
miguel-heygen
left a comment
Collaborator
There was a problem hiding this comment.
Verified at ebd5aef: the bug reproduces on main, and the new tests fail without the fix and pass with it. Required CI is green.
Merged
1 of 2 tasks
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.
What
hyperframes init --non-interactivecloses withcd <name> && npm run dev|check|renderlines to paste. The name now goes into them as a single shell word, quoted when a shell would split or expand it. Thehyperframes open/preview --stophints use the same helper.Why
The name was printed as typed, so any name with a space or quote printed a command that fails when pasted (bash, zsh, and
/bin/shon macOS):my first videocd my first video && npm run checkcd: my: No such file or directory; zsh:cd: too many argumentsit's minecd it's mine && npm run checkunexpected EOF while looking for matching '; zsh:unmatched '서울 여행 브이로그cd 서울 여행 브이로그 && npm run checkcd: 서울: No such file or directory; zsh:too many argumentsWith this change they print
cd "my first video",cd "it's mine"andcd "서울 여행 브이로그", and each runs as written in all three shells. Agents follow these lines verbatim, so a broken one costs them a turn.Related work
desktopApp.ts'sshownDiralready quoted whitespace withJSON.stringifyforhyperframes open "my film"; this generalises that rule and reuses it. I found no issue or PR about it (searched "init cd quote", "project name spaces", "cd command spaces", "shell quote").How
utils/shellArg.ts: plain words (letters, digits,_ . / @ : + , = -, any script) stay bare. Others get double quotes, or POSIX single quotes when the text holds$, a backtick,\,"or!. On Windows they get double quotes, with\paths left bare.init.tsuses it for its fourcdlines andshownDirfor its two commands. ExistingopenCommandFor/previewStopCommandForexpectations ("my film",films/a,.) are unchanged.Test plan
shellArg.test.ts: ten names (plain, Hangul, path, spaces,it's mine,it's,a&b,$HOME,o'neil $x, Hangul with spaces), Windows cases, and a round trip that creates each directory and runscd <shellArg(name)> && pwd -Pthrough/bin/sh.init --non-interactivefor the three names in the table, and pasted the printednpm run checkline (withpwdin place of npm) into/bin/sh, zsh and bash.vitest --project unit src/commands/init src/utils/desktopApp.test.ts src/utils/shellArg.test.ts(138 passed), oxlint, oxfmt,tsc --noEmit, comment ratchet,fallow audit --base origin/main.🤖 Generated with Claude Code