mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
crecord: suspend progress bar when displaying the curses interface
Summary: Nothing currently displays a progress bar while the curses interface is shown, but in the future something may be added which does, so ensure the progress bar is suspended when showing the curses interface. Reviewed By: ryanmce Differential Revision: D7417435 fbshipit-source-id: 6b91b17ee5390cbde6e983081a0940051ab865c8
This commit is contained in:
parent
633d10fe2b
commit
dbf70dc3fd
@ -20,6 +20,7 @@ from . import (
|
||||
encoding,
|
||||
error,
|
||||
patch as patchmod,
|
||||
progress,
|
||||
scmutil,
|
||||
util,
|
||||
)
|
||||
@ -525,10 +526,11 @@ def chunkselector(ui, headerlist, operation=None):
|
||||
if util.safehasattr(signal, 'SIGTSTP'):
|
||||
origsigtstp = signal.getsignal(signal.SIGTSTP)
|
||||
try:
|
||||
curses.wrapper(chunkselector.main)
|
||||
if chunkselector.initerr is not None:
|
||||
raise error.Abort(chunkselector.initerr)
|
||||
# ncurses does not restore signal handler for SIGTSTP
|
||||
with progress.suspend():
|
||||
curses.wrapper(chunkselector.main)
|
||||
if chunkselector.initerr is not None:
|
||||
raise error.Abort(chunkselector.initerr)
|
||||
# ncurses does not restore signal handler for SIGTSTP
|
||||
finally:
|
||||
if origsigtstp is not sentinel:
|
||||
signal.signal(signal.SIGTSTP, origsigtstp)
|
||||
|
Loading…
Reference in New Issue
Block a user