572 curses interface to get selection of chunks, and mark the applied flags |
571 curses interface to get selection of chunks, and mark the applied flags |
573 of the chosen chunks. |
572 of the chosen chunks. |
574 """ |
573 """ |
575 ui.write(_(b'starting interactive selection\n')) |
574 ui.write(_(b'starting interactive selection\n')) |
576 chunkselector = curseschunkselector(headerlist, ui, operation) |
575 chunkselector = curseschunkselector(headerlist, ui, operation) |
577 # This is required for ncurses to display non-ASCII characters in |
|
578 # default user locale encoding correctly. --immerrr |
|
579 locale.setlocale(locale.LC_ALL, '') |
|
580 origsigtstp = sentinel = object() |
576 origsigtstp = sentinel = object() |
581 if util.safehasattr(signal, b'SIGTSTP'): |
577 if util.safehasattr(signal, b'SIGTSTP'): |
582 origsigtstp = signal.getsignal(signal.SIGTSTP) |
578 origsigtstp = signal.getsignal(signal.SIGTSTP) |
583 try: |
579 try: |
584 curses.wrapper(chunkselector.main) |
580 with util.with_lc_ctype(): |
|
581 curses.wrapper(chunkselector.main) |
585 if chunkselector.initexc is not None: |
582 if chunkselector.initexc is not None: |
586 raise chunkselector.initexc |
583 raise chunkselector.initexc |
587 # ncurses does not restore signal handler for SIGTSTP |
584 # ncurses does not restore signal handler for SIGTSTP |
588 finally: |
585 finally: |
589 if origsigtstp is not sentinel: |
586 if origsigtstp is not sentinel: |