Skip to content

Cannot find editor executable with arguments #14893

Open
@RolandMarchand

Description

Describe the bug

My preferred editor is mg and it leaves backup files in the current working directory by default. I prefer to disable that feature with the -n flag, so my EDITOR environment variable is mg -n.

This issue occurs with all editors when passing flags, such as vi.

My use-case can be worked around by using a configuration file and to set my EDITOR environment to mg:

echo "make-backup-files 0\n" | save -a ~/.mg
$env.config.buffer_editor = "mg"
config nu # now works

How to reproduce

  1. Set an editor with a flag: $env.config.buffer_editor = "vi -C"
  2. Call a command that uses the default editor: config nu
  3. The following error is printed:
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #58:1:1]
 1  config nu
   · ────┬────
   ·     ╰── `vi -C` not found
   ╰────
  help: Failed to find the editor executable

Expected behavior

nushell should search for the vi editor and pass it the -C flag instead of looking for an executable named vi -C.

Configuration

key value
version 0.101.1
major 0
minor 101
patch 1
branch main
commit_hash 0666b37
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.84.0 (9fc6b4312 2025-01-07) (Fedora 1.84.0-3.fc41)
cargo_version cargo 1.84.0 (66221abde 2024-11-19)
build_time 2025-01-21 14:45:39 -05:00
build_rust_channel debug
allocator mimalloc
features default, sqlite, trash
installed_plugins

Metadata

Assignees

No one assigned

    Labels

    configurationIssue related to nu's configurationline editorIssues related to reedlinepolishthis problem makes nu feel unpolished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions