I'm trying to better understand VISUAL -- where it is documented, how it relates to EDITOR, and when VISUAL versus EDITOR gets used by external programs.
While working on a , I was trying to demonstrate that when I have EDITOR=nvim in my zsh env, but then I override that for a specific command (like so EDITOR="code --wait" rails console), then when I run edit from rails console it will open VS Code instead of Neovim. It didn't work though. It was continuing to open with Neovim. I did some sleuthing and discovered that another env var in my zsh config VISUAL=nvim was actually what was being used to determine the default editor program. Once I changed it to VISUAL="code --wait" rails console then it opened in VS Code instead.
So to reiterate, I'm trying to understand the history behind VISUAL, where it is documented, and how it relates to EDITOR. I appreciate any insights on this!