The Rails::Command::Helpers::Editor
module, used by the credentials
, encrypted
, and secrets
commands to open a temporary file for editing in the user’s preferred editor, currently only uses the EDITOR
environment variable to know which command to run to open that editor. I believe it should also use the VISUAL
environment variable, and it should prefer it over EDITOR
.
See this StackExchange answer for some context:
The
EDITOR
editor should be able to work without use of “advanced” terminal functionality (like olded
orex
mode ofvi
). It was used on teletype terminals.A
VISUAL
editor could be a full screen editor asvi
oremacs
.E.g. if you invoke an editor through bash (using
C-x C-e
), bash will try firstVISUAL
editor and then, ifVISUAL
fails (because terminal does not support a full-screen editor), it triesEDITOR
.Nowadays, you can leave
EDITOR
unset or set it tovi -e
.
I’m happy to submit a PR for this if others are okay with it!