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

Augie Fackler raf at durin42.com
Sat May 30 01:35:40 UTC 2020



> On May 29, 2020, at 3:08 PM, PIERRE AUGIER <pierre.augier at univ-grenoble-alpes.fr> wrote:
> 
> 
> ----- Mail original -----
>> De: "Marcus Harnisch" <mh-mercurial at online.de>
>> À: "mercurial" <mercurial at mercurial-scm.org>
>> Envoyé: Vendredi 29 Mai 2020 17:38:59
>> Objet: Re: Better mechanism to choose the default editor (and avoid vi if possible)?
> 
>> Is it safe to assume that users who are disturbed by this default
>> behaviour are likely to work in a desktop session? In that case we could
>> make use of XDG, no? I just tried ‘xdg-open ~/.config/hg/hgrc’ and it
>> popped up the configured plain text editor.
>> 
> 
> Yes, I agree that we can assume that users who are disturbed by this default behavior are likely to work in a desktop session, so `xdg-open` seems to be the right command.
> 
> Maybe `open` can be used on OSX and `start` on Windows?

`open` does not block on the file closing, so it’s not viable for the use case. I can’t speak to Windows stuff, or xdg-open (but I suspect they have similar shortcomings). There are flags to let open behave the way you’d want, but I’ve never seen them used in the wild and it’d be confusing to the median Mac user to have two copies of an application open at the same time.

That said, if someone wants to send a patch to change the default editor on Windows to be notepad, I’ll take it (barring objections.) That seems like a trivial improvement. 

I’m -0 on a patch to change the non-Windows default to nano, but I won’t veto it if someone else reviews it and lands it, I guess.

> 
>> Hg is already inspecting XDG_CONFIG_HOME (another XDG facility) for
>> locating the configuration file.
>> 
>> Cheers,
>> Marcus
>> 
>> 
>> _______________________________________________
>> Mercurial mailing list
>> Mercurial at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial
> _______________________________________________
> Mercurial mailing list
> Mercurial at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial




More information about the Mercurial mailing list