[PATCH] commands: possibly start a web browser during `hg serve` (BC)

Gregory Szorc gregory.szorc at gmail.com
Sun Jul 17 13:27:58 EDT 2016

On Sun, Jul 17, 2016 at 3:22 AM, Yuya Nishihara <yuya at tcha.org> wrote:

> On Sat, 16 Jul 2016 14:04:46 +0800, Anton Shestakov wrote:
> > 16.07.2016, 12:58, "Gregory Szorc" <gregory.szorc at gmail.com>:
> > I've been running 3 different browsers with different arguments and
> extensions on 3 different workspaces (Xfce) for a long time and found that
> to be great. Now, if Xfce could pick up my custom menu items or shortcuts
> (it can't) and make one of them the default browser, maaybe I could pick
> just one for every possible case of me running `hg serve` [1]. I assume it
> would still open the browser on the workspace where the terminal with `hg
> serve` is, and not on the workspace I want to keep that browser on. All of
> that would be fairly annoying. Thank you for reading my rant.
> >
> > So I think that opening a browser on `hg serve` without arguments should
> be opt-in (require e.g. web.browser=default, or an argument to the
> command). How about alias.ui = serve --browser?
> Agree. I don't wanna open GUI unintentionally while working in console. So,
>  -1 for default
>  0 for opt-in feature

Fair enough.

> > I also think that for hgweb to become more discoverable, we could just
> fix https://bz.mercurial-scm.org/show_bug.cgi?id=3976 and then write
> "WebUI available at" or something more...
> inviting. Luckily, many terminals actually allow double-clicking or
> right-clicking the link and picking "Open in browser" in the context menu.
> I think it's okay to show "listening at" message even if --port is
> specified.

It occurred to me while writing this that "auto launch a browser UI" is
applicable to a number of commands, much like having command output go to a
pager is. I could envision various commands accepting a "--browser"
argument that would open a browser to show results instead of sending it to
the terminal. I think the built-in web server needs a lot of love before we
could seriously consider this, however.

Taken to its extreme, you could put a "terminal emulator" like terminal.js
or https://hyperterm.org/ into the browser and create Jupyter Notebook
style interactions where you type hg commands into your browser, send them
to a command server, and render HTML results inline.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160717/1d30477a/attachment.html>

More information about the Mercurial-devel mailing list