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
EDITOReditor should be able to work without use of “advanced” terminal functionality (like oldedorexmode ofvi). It was used on teletype terminals.A
VISUALeditor could be a full screen editor asvioremacs.E.g. if you invoke an editor through bash (using
C-x C-e), bash will try firstVISUALeditor and then, ifVISUALfails (because terminal does not support a full-screen editor), it triesEDITOR.Nowadays, you can leave
EDITORunset or set it tovi -e.
I’m happy to submit a PR for this if others are okay with it!
