Repository navigation
fix(store): leave the CLI's own process chain out of the editor-open guard - #171
Merged
Merged
Conversation
…guard Under Volta the `capcut` command is a shim executable named `capcut` that starts node, so the guard matched the CLI's own parent as the CapCut editor and refused every --apply. The guard now lists pid and ppid with the process names, leaves out the CLI's own process and every ancestor of it (the direct parent on Windows, where tasklist has no parent ids), and still detects an editor running beside it. Fixes #168
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.
Fixes #168.
Under Volta the
capcutcommand is a shim executable namedcapcutthat starts node. The editor-open guard compared process names only, so it matched the CLI's own parent as the CapCut editor and refused every--apply.The guard now reads
ps -axo pid=,ppid=,comm=(posix) and the PID column oftasklist(Windows), leaves out the CLI's own process and every ancestor of it, and still reports an editor that runs beside it. On Windows, wheretasklistlists no parent ids, the direct parent is left out.matchEditorProcesseskeeps its name-only behaviour from #99.Evidence
npm test: 1392 tests, 1390 pass, 0 fail (2 skipped);biome check --error-on-warnings src/ test/: no issues.test/editor-processes.test.mjs: a Volta shim chain (.volta/bin/capcut-> node) is ignored; an editor beside that chain is still detected; the whole parent chain is walked; a command name with spaces stays whole; on Windows the direct parent is left out and a realCapCut.exeis still found.psintest/sync-timelines.test.mjsanswers in the newpid ppid commformat; "refuses --apply while the editor is running unless --force-write" passes with it.Door
Two-way door: a guard-only change, reverted by reverting this commit; no draft data, file format or flag changes.
Blast radius
Only the editor-open check before writes (
editorProcessesinsrc/store.ts) on macOS, Linux and Windows. If the process listing cannot be read the guard reports no editor, as before.