pager and stderr

Durham Goode durham at fb.com
Fri Nov 20 15:02:34 CST 2015



On 11/20/15 12:35 PM, Bryan O'Sullivan wrote:
> Is it expected that the pager extension captures both stdout and stderr?
>
> I ask because I've added some code that, if Mercurial is sent SIGUSR1, 
> it prints a traceback to stderr, which is helpful in figuring out what 
> a long-running command is doing.
>
> Unfortunately, this is clearly going to the pager when it's enabled 
> (i.e. always), which results in the process blocking until I notice 
> that I need to hit page-down.
>
> The only references I can find to this behaviour are as follows:
>
> https://bz.mercurial-scm.org/show_bug.cgi?id=2541 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__bz.mercurial-2Dscm.org_show-5Fbug.cgi-3Fid-3D2541&d=CwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=XGLIF56HEOpV1LrL7VVKkH2Egft2Wn9Xhf9fngMut1I&s=UTeSul1Jjl6eGfoVlbK3F5oVf3BSQfQlHEWroK8QZWo&e=>
> https://selenic.com/repo/hg/rev/994510694b1d
>
> It seems highly undesirable to me to have stderr go through the pager. 
> Am I alone?
>
If stderr didn't go to the pager, wouldn't it just get written out on 
top of the pager's output?  Like, if we ran 'hg log' and it encountered 
an exception after having filled a page with text, would the exception 
get dumped to stderr mess up the existing pager output?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151120/d56f0b05/attachment.html>


More information about the Mercurial-devel mailing list