Closed fmang closed 3 years ago
If I set VISUAL=emacsclient
, no problem. If I set VISUAL="emacsclient -c"
then
error: execvp failed: No such file or directory
I presume it is not passing the command to the shell or attempting to tokenize it?
The shell is not called indeed.
I guess it works with other tools though, and I don’t know which solution is best between calling the shell after escaping the path name, or tokenizing EDITOR.
EDITOR='
echo vim' git commit
works, so Git surely passes EDITOR as is to the shell. I could reuse Git’s escaping logic: https://github.com/git/git/blob/385c171a018f2747b329bcfa6be8eda1709e5abd/quote.c
Tokenizing would be simple to implement too provided we decide not to support weird values like things with backticks.
I’ll try using the shell, and possibly replace execvp by a system() call.
Or it might be possible to use wordexp(3)
?
Or it might be possible to use
wordexp(3)
?
Wow, I didn’t know about this function. I tried it and it’s perfect! Thanks for the tip.
Or it might be possible to use
wordexp(3)
?
I only found out about it recently and by accident, and I didn't even need it!
@rrthomas Here’s as you suggested. Please tell me if that works for you.
VISUAL is only used if you have a TERM set. I copied the logic of Git again :)
Close #35.