Rails::Command::Helpers::Editor module, used by the
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
See this StackExchange answer for some context:
EDITOReditor should be able to work without use of “advanced” terminal functionality (like old
vi). It was used on teletype terminals.
VISUALeditor could be a full screen editor as
E.g. if you invoke an editor through bash (using
C-x C-e), bash will try first
VISUALeditor and then, if
VISUALfails (because terminal does not support a full-screen editor), it tries
Nowadays, you can leave
EDITORunset or set it to
I’m happy to submit a PR for this if others are okay with it!