adopt POSIX EDITOR environment variable
POSIX has supported a common EDITOR environment variable for configuring the default console text editor for decades. This is the same environment variable used by git and other applications, when deciding which editor to launch.
Propose deprecating the editor TOML section in favor of this parameter.
As an intermediate step, we could apply logic like:
Default the editor command to nano. This tends to be installed by default in even more distributions than vi(m), so rio is more likely to work correctly out of the box on more UNIX distributions.
If a COMSPEC environment variable is defined, then assume a non-UNIX-like Windows environment (as opposed to WLS, Cygwin, MinGW, Minsysgit, Git Bash, Strawberry Perl sh, UNIX VM, UNIX container, etc.) and override the editor command with edit, the longstanding Windows console editor. notepad is an external process whose clunky integration makes rio look unnecessarily bad, begging for a true GUI settings pane.
Check whether an environment variable EDITOR exists. If it does, then override the editor command to that value.
(Deprecated) Check whether an [editor] TOML section exists. If it does, then apply these overrides.
Hey @mcandre thanks for the issue, if the configuration isn't settled, not found or is empty then will use $EDITOR
But isn't it incredibly likely that vi is found on the path? $EDITOR should be preferred to the default vi.
nano is more minimalist and installed on even more platforms than vi.
My own preferred editor in terminals is Vi(m). But for portability nano is more ideal.
Problem of using EDITOR environment variable over rio is that people would like to configure rio config over env variable sometimes.
I think maybe editor should start empty and if the user would like to use this, then would require further configuration. At least on linux, macos and windows is easier to deal with default editors