Page MenuHomePhabricator

serve: add an option to open in the default browser
Needs RevisionPublic

Authored by nspanti-logilab on May 24 2018, 9:35 AM.

Details

Reviewers
baymax
Group Reviewers
hg-reviewers
Summary

It is inspired by a similar functionality in pydoc. -g/--graphical may not be adequate, the only other idea that I have is -w/--window.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

nspanti-logilab edited the summary of this revision. (Show Details)May 24 2018, 9:39 AM
nspanti-logilab added a project: Restricted Project.

I don't love the flag name, and am -0 on the feature in general. All terminal emulators I've used in the last 10 years have URL detection logic and make clicking the link trivial...

av6 added a subscriber: av6.Jun 2 2018, 9:04 AM

D3649 mentions xdg-open "$(hg serve --print-url)", which shows that --print-url can nearly replace --graphical and is more versatile.

pulkit added a subscriber: pulkit.Jun 14 2018, 3:47 PM

Do we need this patch any more since D3649 has landed and we can do xdg-open "$(hg serve --print-url)"?

For laziness, this patch could be also useful. It is also better for text shell beginners, because they may not know that they can combine commands like that (even if it is basic). Moreover, you can still use hg serve in foreground or use it in background and give the result of --print-url to a non web browser application (but I imagine that there is a way to duplicate stdout to multiple programs). These are the advantages of this patch that I see over --print-url of D3649. It is better for convenience and require less knowledge for the user, but it is not a need. D3649 was precisely suggested to me because it can fulfill the functionality of the current patch and is more versatile.

yuja added a subscriber: yuja.Jun 16 2018, 9:21 AM

(Resend because I forgot to remove the "someone wrote:" line again, sorry.)

For laziness,  this patch could be also useful. It is also better for text shell beginners, because they may not know that they can combine commands like that (even if it is basic).

For laziness, we can add it to [alias]. I'm not a fan of adding lots of
one-off options since that's the source of man page bloat.

How about document the xdg-open example in hg help serve -v?

baymax requested changes to this revision.Jan 24 2020, 12:32 PM

There seems to have been no activities on this Diff for the past 3 Months.

By policy, we are automatically moving it out of the need-review state.

Please, move it back to need-review without hesitation if this diff should still be discussed.

:baymax:need-review-idle:

This revision now requires changes to proceed.Jan 24 2020, 12:33 PM