Skip to content

fix(windows): restore /editor support on Windows#17146

Merged
Hona merged 1 commit intoanomalyco:devfrom
AbigailJixiangyuyu:fix/windows-editor-unavailable-17117
Mar 16, 2026
Merged

fix(windows): restore /editor support on Windows#17146
Hona merged 1 commit intoanomalyco:devfrom
AbigailJixiangyuyu:fix/windows-editor-unavailable-17117

Conversation

@AbigailJixiangyuyu
Copy link
Contributor

@AbigailJixiangyuyu AbigailJixiangyuyu commented Mar 12, 2026

Issue for this PR

Closes #17117

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This fixes /editor being unavailable on Windows.

I referred to the Node.js child_process documentation for Windows command
spawning behavior:
https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows

According to that documentation, .bat and .cmd files may need to be launched
through a shell on Windows. In practice, commands such as $env:EDITOR = "code --wait"
could hang or fail to launch correctly when spawned without shell support.

This PR enables shell when launching the editor on Windows, so editor commands
like code --wait can be started correctly there and /editor works again.

How did you verify your code works?

Tested locally on Windows by running /editor and confirming:

  • the editor opens correctly
  • the edited content is saved and returned correctly

Screenshots / recordings

Included below.
image
image
Then close code.
image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@Hona
Copy link
Member

Hona commented Mar 16, 2026

/review

@github-actions
Copy link
Contributor

lgtm

@Hona
Copy link
Member

Hona commented Mar 16, 2026

later we might have issues with spaces in EDITOR or file name, but for now this is better

@Hona Hona merged commit e9a17e4 into anomalyco:dev Mar 16, 2026
15 checks passed
ConanXu-math pushed a commit to ConanXu-math/opencode that referenced this pull request Mar 17, 2026
AvatarGanymede pushed a commit to AvatarGanymede/opencode-dev that referenced this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On the Windows platform, starting from v1.2.12, /editor is unavailable.

2 participants