config edit handed the whole of $EDITOR to the system as one program name, so any value with arguments (code --wait, emacsclient -t, cat -n) failed with "executable file not found in $PATH".
It now runs $EDITOR through sh the way git does: sh -c with the $EDITOR text followed by "$@", and the config path as a separate argument. The shell parses the editor text, so its arguments and any quoting in it work; the path is never written into the command text, so a path with spaces or quotes reaches the editor whole. With $EDITOR unset it still falls back to vi.
The new test sets $EDITOR to cp with a replacement file as its argument and runs config edit on a config whose file name contains a space; the config ends up with the replacement's content only if both the argument and the whole path arrived.
Judgement call: $EDITOR is now shell text, so shell metacharacters in it are interpreted, as they are for git and crontab.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/vaultik/issues/315.
`config edit` handed the whole of `$EDITOR` to the system as one program name, so any value with arguments (`code --wait`, `emacsclient -t`, `cat -n`) failed with "executable file not found in $PATH".
It now runs `$EDITOR` through `sh` the way git does: `sh -c` with the `$EDITOR` text followed by `"$@"`, and the config path as a separate argument. The shell parses the editor text, so its arguments and any quoting in it work; the path is never written into the command text, so a path with spaces or quotes reaches the editor whole. With `$EDITOR` unset it still falls back to `vi`.
The new test sets `$EDITOR` to `cp` with a replacement file as its argument and runs `config edit` on a config whose file name contains a space; the config ends up with the replacement's content only if both the argument and the whole path arrived.
Judgement call: `$EDITOR` is now shell text, so shell metacharacters in it are interpreted, as they are for git and crontab.
Model: opus-5-5
config edit used the whole of $EDITOR as the program name, so a value
with arguments such as "code --wait" or "emacsclient -t" failed with
"executable file not found". It now runs $EDITOR the way git does:
sh -c '<editor> "$@"' with the config path as a separate argument, so
the editor's own arguments and quoting work and a path with spaces
reaches it whole. A test runs config edit with an $EDITOR carrying an
argument on a config path that contains a space.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #315.
config edithanded the whole of$EDITORto the system as one program name, so any value with arguments (code --wait,emacsclient -t,cat -n) failed with "executable file not found in $PATH".It now runs
$EDITORthroughshthe way git does:sh -cwith the$EDITORtext followed by"$@", and the config path as a separate argument. The shell parses the editor text, so its arguments and any quoting in it work; the path is never written into the command text, so a path with spaces or quotes reaches the editor whole. With$EDITORunset it still falls back tovi.The new test sets
$EDITORtocpwith a replacement file as its argument and runsconfig editon a config whose file name contains a space; the config ends up with the replacement's content only if both the argument and the whole path arrived.Judgement call:
$EDITORis now shell text, so shell metacharacters in it are interpreted, as they are for git and crontab.Model: opus-5-5
Review passed.
Model: opus-5-5