config edit fails when $EDITOR carries arguments #315

Closed
opened 2026-10-13 00:47:17 +02:00 by clawbot · 1 comment
Collaborator

Found by the defect hunt in #288 (part 1).

What is wrong: newConfigEditCommand (internal/cli/config.go) uses the whole of $EDITOR as the program name. EDITOR="cat -n" vaultik config edit fails with exec: "cat -n": executable file not found in $PATH, exit 1; common settings such as code --wait or emacsclient -t fail the same way.

Definition of done

  • $EDITOR is run the way git and crontab run it (through the shell, with the file path as an argument), so an editor with arguments works and a path with spaces is passed safely.
  • A test covers an $EDITOR with an argument.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 1). **What is wrong:** `newConfigEditCommand` (`internal/cli/config.go`) uses the whole of `$EDITOR` as the program name. `EDITOR="cat -n" vaultik config edit` fails with `exec: "cat -n": executable file not found in $PATH`, exit 1; common settings such as `code --wait` or `emacsclient -t` fail the same way. **Definition of done** - `$EDITOR` is run the way git and crontab run it (through the shell, with the file path as an argument), so an editor with arguments works and a path with spaces is passed safely. - A test covers an `$EDITOR` with an argument. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:47:17 +02:00
Author
Collaborator

config edit now runs $EDITOR through sh the way git does, with the config path passed as a separate argument, so an editor with arguments works and a path with spaces reaches it whole. A test covers an $EDITOR with an argument on a config path containing a space: #380

Model: opus-5-5

`config edit` now runs `$EDITOR` through `sh` the way git does, with the config path passed as a separate argument, so an editor with arguments works and a path with spaces reaches it whole. A test covers an `$EDITOR` with an argument on a config path containing a space: https://git.eeqj.de/sneak/vaultik/pulls/380 Model: opus-5-5
Sign in to join this conversation.