diff --git a/hgext/pager.py b/hgext/pager.py index 369741ef7253f385614494bcf52923188ed263f1_aGdleHQvcGFnZXIucHk=..0c0c1101e46da30be2a84e371f9b5a41734e245f_aGdleHQvcGFnZXIucHk= 100644 --- a/hgext/pager.py +++ b/hgext/pager.py @@ -22,12 +22,6 @@ If no pager is set, the pager extensions uses the environment variable $PAGER. If neither pager.pager, nor $PAGER is set, no pager is used. -If you notice "BROKEN PIPE" error messages, you can disable them by -setting:: - - [pager] - quiet = True - You can disable the pager for certain commands by adding them to the pager.ignore list:: @@ -91,4 +85,8 @@ (cmd not in ui.configlist('pager', 'ignore') and not attend))): ui.setconfig('ui', 'formatted', ui.formatted()) ui.setconfig('ui', 'interactive', False) + try: + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + except ValueError: + pass _runpager(p) @@ -94,6 +92,4 @@ _runpager(p) - if ui.configbool('pager', 'quiet'): - signal.signal(signal.SIGPIPE, signal.SIG_DFL) return orig(ui, options, cmd, cmdfunc) extensions.wrapfunction(dispatch, '_runcommand', pagecmd)