pager: catch ctrl-c on exit (issue3834)
authorMatt Mackall <mpm@selenic.com>
Fri, 22 Feb 2013 15:17:33 -0600
changeset 18717 fcc4b55876c3
parent 18716 963468e9f9e5
child 18718 c8c3887a24c1
pager: catch ctrl-c on exit (issue3834)
hgext/pager.py
--- a/hgext/pager.py	Fri Feb 22 13:46:54 2013 -0600
+++ b/hgext/pager.py	Fri Feb 22 15:17:33 2013 -0600
@@ -94,6 +94,8 @@
 
     @atexit.register
     def killpager():
+        if util.safehasattr(signal, "SIGINT"):
+            signal.signal(signal.SIGINT, signal.SIG_IGN)
         pager.stdin.close()
         os.dup2(stdout, sys.stdout.fileno())
         os.dup2(stderr, sys.stderr.fileno())