-
Notifications
You must be signed in to change notification settings - Fork 0
fix: a Windows-path-aware commandArgv0 #516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e13d144
docs: brief the Windows-path-aware commandArgv0 fix
nedtwigg d2d2fbf
fix(terminal-state): keep Windows paths intact through the command to…
nedtwigg 64e5728
refactor(terminal-state): share the escapable set, and honor PowerShe…
nedtwigg ea36545
fix(terminal-state): drop the unquoted-Windows-path join; strip launc…
nedtwigg 714da04
fix(lib): keep terminal-state.ts dependency-free
nedtwigg 4a47693
fix(terminal-state): one name per program across header, rule row, an…
nedtwigg f8f2ca2
test(watched-commands): pin the write-path half of the keyable gate
nedtwigg 0698588
fix(terminal-state): a launcher suffix is not part of a program's name
nedtwigg 72f01c1
fix(watched-commands): drop the keys the suffix strip stranded
nedtwigg 2ca3b44
docs(alert): the WATCHING key is a basename minus any launcher suffix
nedtwigg af7a7b2
fix: narrow drive filter and admit argv0 escape cost
nedtwigg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * The one definition of "characters a POSIX shell backslash-escapes", shared by | ||
| * the two halves that have to agree about it: | ||
| * | ||
| * - `shellEscapePosix` (`shell-escape.ts`) *writes* them, backslash-escaping | ||
| * each one so a dropped path pastes as a path rather than as opaque text. | ||
| * - `tokenizeCommand` (`terminal-state.ts`) *reads* them back, treating `\` | ||
| * before anything else as a literal path separator so a native Windows | ||
| * program path survives to the basename split. | ||
| * | ||
| * They disagreed once, about `~`, and a path Dormouse itself escaped rendered | ||
| * with a stray backslash in the pane header. `terminal-state.test.ts` -> | ||
| * "command tokenizer dialects" pins both directions character by character. | ||
| * | ||
| * Its own module because `terminal-state.ts` is bundled into the VS Code | ||
| * extension host, which resolves the `dor/*` path `shell-escape.ts` imports only | ||
| * through a tsconfig mapping its vitest run does not read — so this file must | ||
| * stay dependency-free. | ||
| */ | ||
| export const POSIX_ESCAPABLE = /[ \t!"#$&'()*;<>?[\\\]`{|}~]/; |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified against this branch, the key is
tools$claude—commandProgramNamestrips the.exeafter the mangled basename split, so the example predates the suffix strip landing in this PR:The corrected value also flips the consequence.
tools$claude.exewould be dropped byisKeyableName(launcher suffix), so the comment as written reads like the cost is self-cleaning;tools$claudepasses all three clauses, so it persists as a second rule row for the program a bareclaudekeys asclaude.