Better mechanism to choose the default editor (and avoid vi if possible)?

Marcus Harnisch mh-mercurial at online.de
Sun Jun 7 11:35:06 UTC 2020


On 06/06/2020 23.24, Manuel Jacob wrote:
> In my opinion, on a UNIX-style system, if a distribution targets an 
> audience that includes non-power users, it’s the responsibility of the 
> distribution to set $VISUAL or $EDITOR to a user-friendly default, or 
> patch Mercurial to choose a user-friendly default. We should refrain 
> from doing the distribution’s job. If every application had its own way 
> of choosing an editor, the result wouldn’t be very user-friendly.

Thanks, this was also my conclusion:

On 06/06/2020 12.29, Marcus Harnisch wrote:
 > As far as I see it, the lowest common denominator is in fact vi.
 > Anything else is up to the distribution package maintainers. They
 > would be responsible for selecting required or recommended packages,
 > sensible-editors and such.
 >
 > People installing Mercurial from source are in the same role as
 > packager maintainers and likewise responsible for their user
 > base. Perhaps the installation instructions should point out more
 > prominently that the system-wide config may need to be adapted with
 > respect to this important user-facing value.

On 06/06/2020 23.24, Manuel Jacob wrote:
> Is there any standard demanding to open vi if neither $VISUAL nor 
> $EDITOR is defined?

Not explicitly, AFAIK, but there is SUS/POSIX[1] which define vi as the
standard (full-screen) text editor. That's why I think that *if* a
hardcoded fallback is to be implemented, vi is perhaps the best choice
on Unixoid systems.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/




More information about the Mercurial mailing list