##// END OF EJS Templates
Workaround so only one CTRL-C is required for a new prompt in --gui=qt...
Siyu Zhang -
Show More
@@ -116,8 +116,22 b' def create_inputhook_qt4(mgr, app=None):'
116 except KeyboardInterrupt:
116 except KeyboardInterrupt:
117 ignore_CTRL_C()
117 ignore_CTRL_C()
118 got_kbdint[0] = True
118 got_kbdint[0] = True
119 print("\nKeyboardInterrupt - Ctrl-C again for new prompt")
120 mgr.clear_inputhook()
119 mgr.clear_inputhook()
120 import os, signal, time, threading
121 if(os.name == 'posix'):
122 pid = os.getpid()
123 print("^C")
124 thread = threading.Thread(
125 target = lambda:
126 ( time.sleep(.1),
127 os.kill(pid, signal.SIGINT) )
128 )
129
130 thread.start()
131 else:
132 print("\nKeyboardInterrupt - Ctrl-C again for new prompt")
133
134
121 except: # NO exceptions are allowed to escape from a ctypes callback
135 except: # NO exceptions are allowed to escape from a ctypes callback
122 ignore_CTRL_C()
136 ignore_CTRL_C()
123 from traceback import print_exc
137 from traceback import print_exc
General Comments 0
You need to be logged in to leave comments. Login now