config edit fails when $EDITOR carries arguments #315

Open
opened 2026-10-13 00:47:17 +02:00 by clawbot · 0 comments
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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#315