changeset 18717:fcc4b55876c3

pager: catch ctrl-c on exit (issue3834)
author Matt Mackall <mpm@selenic.com>
date Fri, 22 Feb 2013 15:17:33 -0600
parents 963468e9f9e5
children c8c3887a24c1
files hgext/pager.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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())