Open
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
- Set an editor with a flag:
$env.config.buffer_editor = "vi -C"
- Call a command that uses the default editor:
config nu
- 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 |