From 70e54005eec67f8004338d672347dcc6ba1c61d3 Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Wed, 24 Dec 2008 03:31:39 +0000 Subject: [PATCH] Send an explicit sighup from closeterm() --- terminatorlib/terminator.py | 1 + terminatorlib/terminatorterm.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 1a675361..dd518092 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -818,6 +818,7 @@ class Terminator: dbg ("closeterm function called while in zoomed mode. Restoring previous layout before closing.") self.toggle_zoom(widget, not self._maximised) + widget.sighup() if self.remove(widget): widget.destroy () return True diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index b27b74be..5f328f65 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -19,7 +19,7 @@ import pygtk pygtk.require ("2.0") import gobject, gtk, pango -import os, sys, subprocess, pwd, re +import os, signal, sys, subprocess, pwd, re #import version details from terminatorlib.version import * @@ -501,6 +501,12 @@ text/plain err (_('Unable to start shell: ') + shell) return (-1) + def sighup (self): + try: + os.kill(self._pid, signal.SIGHUP) + except OSError: + dbg('Unable to send SIGHUP to %d' % self._pid) + def get_cwd (self): """ Return the current working directory of the subprocess. This function requires OS specific behaviours