Editor Open Error in Windows #299

Closed
opened 2026-02-16 17:26:07 -05:00 by yindo · 6 comments
Owner

Originally created by @Jimit-MTPL on GitHub (Jun 26, 2025).

Originally assigned to: @thdxr on GitHub.

I have grabbed the binary from here for windows: https://github.com/sst/opencode/releases

and also setup the Anthropic API key but /editor commands gives me this error: "no editor set can't open editor"

Is there any fix for this issue or currently it is not fully supported in windows ?

Originally created by @Jimit-MTPL on GitHub (Jun 26, 2025). Originally assigned to: @thdxr on GitHub. I have grabbed the binary from here for windows: https://github.com/sst/opencode/releases and also setup the Anthropic API key but /editor commands gives me this error: "no editor set can't open editor" Is there any fix for this issue or currently it is not fully supported in windows ?
yindo closed this issue 2026-02-16 17:26:07 -05:00
Author
Owner

@cravenceiling commented on GitHub (Jun 26, 2025):

Have you set the EDITOR env variable?

@cravenceiling commented on GitHub (Jun 26, 2025): Have you set the `EDITOR` env variable?
Author
Owner

@Jimit-MTPL commented on GitHub (Jun 26, 2025):

No i have tried to find the steps to set this but didn't able to find any instruction. It would be great if you guide me to setup this in Windows.

@Jimit-MTPL commented on GitHub (Jun 26, 2025): No i have tried to find the steps to set this but didn't able to find any instruction. It would be great if you guide me to setup this in Windows.
Author
Owner

@QDaed commented on GitHub (Jun 26, 2025):

i've the same question how to setup editor on windows

@QDaed commented on GitHub (Jun 26, 2025): i've the same question how to setup editor on windows
Author
Owner

@cravenceiling commented on GitHub (Jun 26, 2025):

Well... I'm not a windows user but this is chatGPT's answer.

Permanently (System/User Level)

Option 1: Using System Settings GUI

  1. Press Win + S, search for “Environment Variables” and open “Edit the system environment variables.”

  2. In the System Properties window, click “Environment Variables…”

  3. Under User variables or System variables, click “New…”

  4. Set:

    • Variable name: EDITOR

    • Variable value: vscode (for example)

  5. Click OK → OK → OK to close all windows.

  6. Restart any open terminals or apps to load the new variable.

@cravenceiling commented on GitHub (Jun 26, 2025): Well... I'm not a windows user but this is chatGPT's answer. ✅ Permanently (System/User Level) Option 1: Using System Settings GUI 1. Press Win + S, search for “Environment Variables” and open “Edit the system environment variables.” 2. In the System Properties window, click “Environment Variables…” 3. Under User variables or System variables, click “New…” 4. Set: - Variable name: EDITOR - Variable value: vscode (for example) 5. Click OK → OK → OK to close all windows. 6. Restart any open terminals or apps to load the new variable.
Author
Owner

@sl5net commented on GitHub (Jul 5, 2025):

EDITOR Variable to vscode using Linux (Manjaro)

  • Variable name: EDITOR
  • Variable value: vscode (for example)
    To set the EDITOR environment variable in Linux (Manjaro) to use Visual Studio Code (VSCode), you need to:
    Find the Path to VSCode:
  • If you installed VSCode from the official Manjaro repository or via Snap/Flatpak, it is usually available as the command code.
  • You can check its path by running:
    bash
which code

Example output: /usr/bin/code

  • Set the EDITOR Variable Temporarily (for current terminal session):
    bash

export EDITOR="code --wait"


- The `--wait` flag is important, as it tells VSCode to wait until you close the file before returning control to the terminal.
- **Set the EDITOR Variable Permanently:**

- Open your shell profile in an editor (e.g. `.bashrc`, `.zshrc`, or `.profile` depending on your shell):

bash

kate ~/.bashrc

or for zsh:

kate ~/.zshrc

Add the following line at the end:
bash

export EDITOR="code --wait"

- Save and exit, then reload your profile:
bash

source ~/.bashrc

or bash

source ~/.zshrc

**Summary:**
- Find VSCode’s path: `which code`
- Add `export EDITOR="code --wait"` to your shell profile
- Reload your profile or restart the terminal
Now, when you use commands that open the default editor (like `git commit` or `crontab -e`), VSCode will be used.
echo $EDITOR
code --wait
@sl5net commented on GitHub (Jul 5, 2025): ### EDITOR Variable to vscode using Linux (Manjaro) - Variable name: EDITOR - Variable value: vscode (for example) To set the `EDITOR` environment variable in Linux (Manjaro) to use Visual Studio Code (VSCode), you need to: **Find the Path to VSCode:** - If you installed VSCode from the official Manjaro repository or via Snap/Flatpak, it is usually available as the command `code`. - You can check its path by running: bash ``` which code ``` Example output: `/usr/bin/code` - **Set the EDITOR Variable Temporarily (for current terminal session):** bash - ``` export EDITOR="code --wait" ``` - The `--wait` flag is important, as it tells VSCode to wait until you close the file before returning control to the terminal. - **Set the EDITOR Variable Permanently:** - Open your shell profile in an editor (e.g. `.bashrc`, `.zshrc`, or `.profile` depending on your shell): bash ``` kate ~/.bashrc ``` or for zsh: ``` kate ~/.zshrc ``` Add the following line at the end: bash ``` export EDITOR="code --wait" ``` - Save and exit, then reload your profile: bash ``` source ~/.bashrc ``` or bash ``` source ~/.zshrc ``` **Summary:** - Find VSCode’s path: `which code` - Add `export EDITOR="code --wait"` to your shell profile - Reload your profile or restart the terminal Now, when you use commands that open the default editor (like `git commit` or `crontab -e`), VSCode will be used. echo $EDITOR code --wait
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

closing since this is documented better now

@rekram1-node commented on GitHub (Oct 21, 2025): closing since this is documented better now
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#299