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