Better mechanism to choose the default editor (and avoid vi if possible)?
Marcus Harnisch
mh-mercurial at online.de
Sat May 30 09:20:01 UTC 2020
On 30/05/2020 08.42, Steve - Gadget Barnes wrote:
> Several other version control systems, (and other systems as well), honour the environmental variable EDITOR - this is an easy way to specify the editor to use for things like hg config --edit without having to use an editor that you are less than happy with. Maybe honouring this and possibly adding mention of it to the helps would be the optimal way to go!
Mercurial already does this. And it is mentioned in the help text. If
the evaluation sequence according to Pierre in a previous message is
correct, the help text would need to be amended though. Currently it
only says:
"editor"
The editor to use during a commit. (default: "$EDITOR" or "vi")
The assumption is (I guess) that users who didn't grow up using the
console will likely not even be aware of such conventions. In that case
they would arguably not even use Hg from the commandline though.
It is true that xdg-open (1.1.2) does not provide an option to block.
This could be somewhat mitigated by a query for the application,
followed by starting it explicitly.
$ xdg-mime query default text/plain
xed.desktop
$
Which now relies on the configured editor to block (FWIW, xed does).
In any case, *if* any of this is going to be implemented it should be
the last action before using vi as fallback. It is the POSIX standard
(full screen) editor after all.
More information about the Mercurial
mailing list