Skip to content

[BUG] [v0.0.7] cortex workspace edit cannot use editor commands that include flags like code --wait #53428

Description

@lucaserevo

Project

cortex

Description

Many developers set EDITOR or pass --editor using a command line that includes flags, such as code --wait or subl -w, to ensure the editor blocks until the file is closed. Cortex passes the entire string to Command::new as a single executable name on many platforms, which fails because code --wait is not a single binary. Users experience opaque OS errors (“not found”) even when VS Code is installed and on PATH. The product either needs argv splitting (shell-like parsing) or an explicit, documented contract that only a bare executable name is supported, plus examples for common editors.

Error Message

Debug Logs

System Information

OS: Windows 11

Screenshots

https://github.com/springoliver/bounty_challenge_report_image/blob/main/49105.mp4

Steps to Reproduce

  1. Run $env:EDITOR="code --wait", cortex workspace edit.
  2. Or run cortex workspace edit --editor 'code --wait'.
  3. Observe the command failure.

Expected Behavior

Cortex should split the editor command and its flags correctly, or clearly document that only a bare executable name is supported.

Actual Behavior

Cortex tries to execute the full string code --wait as a single binary name and fails before opening the config file.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already exists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions