##// END OF EJS Templates
pager: exit cleanly on SIGPIPE (BC)...
Simon Farnsworth -
r30897:253d5c0f default
parent child Browse files
Show More
@@ -72,6 +72,7 b' from mercurial import ('
72 72 commands,
73 73 dispatch,
74 74 encoding,
75 error,
75 76 extensions,
76 77 util,
77 78 )
@@ -105,6 +106,9 b' def _runpager(ui, p):'
105 106 pager.stdin.close()
106 107 pager.wait()
107 108
109 def catchterm(*args):
110 raise error.SignalInterrupt
111
108 112 def uisetup(ui):
109 113 class pagerui(ui.__class__):
110 114 def _runpager(self, pagercmd):
@@ -144,6 +148,8 b' def uisetup(ui):'
144 148 if usepager:
145 149 ui.setconfig('ui', 'formatted', ui.formatted(), 'pager')
146 150 ui.setconfig('ui', 'interactive', False, 'pager')
151 if util.safehasattr(signal, "SIGPIPE"):
152 signal.signal(signal.SIGPIPE, catchterm)
147 153 ui._runpager(p)
148 154 return orig(ui, options, cmd, cmdfunc)
149 155
General Comments 0
You need to be logged in to leave comments. Login now