Repository navigation
Description
Summary
With capcut-cli installed through Volta, every mutating command on a draft inside the managed store (~/Movies/CapCut/User Data/Projects/com.lveditor.draft/...) is refused with refused [editor-open]: CapCut is running, even though CapCut is fully closed.
The fix for #99 replaced substring matching with an exact basename comparison in matchEditorProcesses(). That fixes npx, but Volta's shim binary is itself named capcut, so after lowercasing the two names still collide.
Environment
- macOS darwin 27.0.0 (arm64)
- Node v22.23.1
- capcut-cli 0.32.0 installed via Volta (
~/.volta/bin/capcut→volta-shim) - CapCut 9.6.0, not running during every step below
Reproduction
$ pgrep -x CapCut ; echo "exit=$?"
exit=1 # CapCut is not running
$ ps -axo comm= | grep -ic capcut
0 # nothing matches at rest
$ capcut diagnose "<draft>" | jq .editor_running
["CapCut"]
$ capcut remove "<draft>" <segment-id>
{"error":"refused [editor-open]: CapCut is running. Close the editor before writing this managed draft, or pass --force-write if you accept that the app may overwrite the change."}Sampling ps while any capcut command runs shows what it matched — its own Volta shim process:
$ ( sleep 6 | capcut serve >/dev/null 2>&1 & ) ; sleep 1.5
$ ps -axo pid,comm | grep -i capcut
48878 capcut
$ ps -axo pid,args | grep capcut | grep -v grep
48878 capcut serve
48880 node /Users/<me>/.volta/tools/image/packages/capcut-cli/bin/capcut servematchEditorProcesses() lowercases both sides of the comparison, so the shim's capcut matches the editor list's CapCut.
Workaround
Invoking the packaged entry point directly bypasses the shim's process name, and the same write then succeeds:
$ node "$(npm root -g)/capcut-cli/dist/index.js" diagnose "<draft>" | jq .editor_running
[]Also note the guard only applies to managed store paths (isManagedDraftPath() matches /com.lveditor.draft/). Writes to a /tmp copy of the same draft are unaffected, which makes the false positive easy to miss until you edit a real project.
Suggested fix
- Skip the current process and its ancestor chain when scanning
ps -axo comm=— Volta re-execs, so the shim is an ancestor of the CLI process. - Or only treat a match as the editor when the comm path looks like an app bundle (
.../CapCut.app/Contents/MacOS/CapCut) rather than a barecapcut. - Or compare the POSIX executable name case-sensitively.
Related
- editor-open guard false-positives under npx: editorProcesses() substring-matches the whole ps listing and detects its own npm process #99 — same class of false positive under
npx(self-detection), closed by switching to exact-basename matching.
Activity
fix(store): leave the CLI's own process chain out of the editor-open …
renezander030 commentedon Nov 7, 2026
Thanks for the report, you're right. Under Volta the
capcutcommand is a shim binary with that exact name, and the editor check matched it by name as if CapCut were open. The fix makes the check skip the CLI's own process and its parents, so a real CapCut is still detected, and it will be in the next release. Until then--force-writegets past the check.