aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2014-10-26 22:02:20 +0100
committerSebastian Pipping <sebastian@pipping.org>2014-10-26 22:03:00 +0100
commit7604fb4a01035a88e7fae704f673dc61a927ba69 (patch)
tree0b41151a8dc3258304f0a7b59d062944b5416163
parentRelease 0.7.6.5 (diff)
downloadelogv-7604fb4a01035a88e7fae704f673dc61a927ba69.tar.gz
elogv-7604fb4a01035a88e7fae704f673dc61a927ba69.tar.bz2
elogv-7604fb4a01035a88e7fae704f673dc61a927ba69.zip
Fix resuming from Ctrl+Z/SIGTSTP (Gentoo bug #348110)
-rw-r--r--ChangeLog3
-rwxr-xr-xelogv16
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 325a1eb..e67ae4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
# ChangeLog for elogv
+0.7.6.7
+ * Fix resuming from Ctrl-Z/SIGTSTP (Gentoo bug #348110)
+
0.7.6.5
* Prevent crash with LC_TIME=en_DK (issue #3)
diff --git a/elogv b/elogv
index 8f5ba7c..a693cf4 100755
--- a/elogv
+++ b/elogv
@@ -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)