pager and stderr

Eric Sumner ericsumner at fb.com
Fri Nov 20 15:50:20 CST 2015


I just checked the code for the pager extension, and it only captures stderr if it’s being directed to a terminal;  adding "2> >(cat)” to your command line is a bit ugly, but should prevent pager capture.

  — Eric

From: Mercurial-devel <mercurial-devel-bounces at selenic.com<mailto:mercurial-devel-bounces at selenic.com>> on behalf of Bryan O'Sullivan <bos at serpentine.com<mailto:bos at serpentine.com>>
Date: Friday, November 20, 2015 at 12:35 PM
To: mercurial-devel <mercurial-devel at selenic.com<mailto:mercurial-devel at selenic.com>>
Subject: pager and stderr

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=VwovWMUV-fNle_M0HJe5ZBtAUdM_xQy22OAOSs12ufA&m=D_rrQxl9LVoxUVZJL6qpG9eVq8Ud_7J6JbkxvHWRZ90&s=-j0dSxgocPyJuzKUB115KHlm4wr5tcelHt56mvseQ-4&e=>
https://selenic.com/repo/hg/rev/994510694b1d

It seems highly undesirable to me to have stderr go through the pager. Am I alone?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151120/db43699a/attachment.html>


More information about the Mercurial-devel mailing list