Skip to content

/config edit silently fails when $EDITOR contains arguments (e.g. 'zed --wait') #412

Closed

Description

@ravshansbox

Bug

`/config edit` silently fails when `$EDITOR` is set to a value with arguments.

Root cause

The code does:

let editor = std::env::var("EDITOR").unwrap_or_else(|_| "nano".to_string());
let _ = std::process::Command::new(&editor).arg(&path).spawn();

When `$EDITOR="zed --wait"`, the entire string is used as the binary name instead of being shell-split. The spawn fails silently — no error is shown to the user.

Steps to reproduce

  1. Set EDITOR="zed --wait"
  2. Run /config edit in jcode
  3. Nothing happens, no error message

Expected behavior

Editor opens, or an error is shown if spawn fails.

Fix

Split `$EDITOR` on whitespace before spawning:

let mut parts = editor.split_whitespace();
if let Some(bin) = parts.next() {
    let _ = std::process::Command::new(bin).args(parts).arg(&path).spawn();
}

Activity

  1. added
    bug
    priority: low
    triage: reproducible
    autonomous: clear
    on Jun 29, 2026
  2. 1jehuang commented on Jun 29, 2026

    @1jehuang
    Owner

    Triage: reproducible, autonomous: clear. /config edit used the whole $EDITOR string as the binary name, so values with args (e.g. zed --wait) failed silently. Fixed by shell-splitting $EDITOR (first token = binary, rest = leading args) and surfacing spawn errors. Fix in #417.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: clearbugpriority: lowtriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions