diff options
author | 2014-10-26 22:02:20 +0100 | |
---|---|---|
committer | 2014-10-26 22:03:00 +0100 | |
commit | 7604fb4a01035a88e7fae704f673dc61a927ba69 (patch) | |
tree | 0b41151a8dc3258304f0a7b59d062944b5416163 /elogv | |
parent | Release 0.7.6.5 (diff) | |
download | elogv-7604fb4a01035a88e7fae704f673dc61a927ba69.tar.gz elogv-7604fb4a01035a88e7fae704f673dc61a927ba69.tar.bz2 elogv-7604fb4a01035a88e7fae704f673dc61a927ba69.zip |
Fix resuming from Ctrl+Z/SIGTSTP (Gentoo bug #348110)
Diffstat (limited to 'elogv')
-rwxr-xr-x | elogv | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -31,6 +31,7 @@ import gettext import locale import gzip import bz2 +import signal _LOCALE_CATEGORY_PAIRS = ( (locale.LC_COLLATE, 'LC_COLLATE'), @@ -150,6 +151,18 @@ class CannotOpenElogdir(Exception): def __init__(self): pass + +def handle_sig_tstp(signum, frame): + curses.savetty() + curses.endwin() + os.kill(os.getpid(), signal.SIGSTOP) + + +def handle_sig_cont(signum, frame): + curses.initscr() + curses.resetty() + + def date2str(d): u = d.strftime(date_format).decode(locale.getlocale()[1]) try: @@ -647,6 +660,9 @@ if __name__ == "__main__": else: elogdir = os.path.join(os.sep,port_settings['EPREFIX'],"var","log","portage","elog") + signal.signal(signal.SIGTSTP, handle_sig_tstp) + signal.signal(signal.SIGCONT, handle_sig_cont) + # Launch curses interface try: curses.wrapper(ElogViewer) |