move child spawning outside TerminatorTerm.__init__ mainly so we can set WINDOWID for children

This commit is contained in:
Chris Jones 2008-05-20 00:46:34 +01:00
parent 0e20e435f4
commit 8d1209ac0d
1 changed files with 6 additions and 3 deletions

View File

@ -148,9 +148,7 @@ class TerminatorTerm (gtk.VBox):
if not env_proxy and self.conf.http_proxy: if not env_proxy and self.conf.http_proxy:
os.putenv ('http_proxy', self.conf.http_proxy) os.putenv ('http_proxy', self.conf.http_proxy)
if self.spawn_child () == -1: os.putenv ('COLORTERM', 'gnome-terminal')
# We failed to usefully create a child shell, we need to kill ourself
gobject.timeout_add (100, self.terminator.closeterm, self)
def add_matches (self, lboundry="[[:<:]]", rboundry="[[:>:]]"): def add_matches (self, lboundry="[[:<:]]", rboundry="[[:>:]]"):
userchars = "-A-Za-z0-9" userchars = "-A-Za-z0-9"
@ -204,11 +202,14 @@ class TerminatorTerm (gtk.VBox):
if not os.path.exists (shell): if not os.path.exists (shell):
# Give up, we're completely stuck # Give up, we're completely stuck
print >> sys.stderr, _('Unable to find a shell') print >> sys.stderr, _('Unable to find a shell')
gobject.timeout_add (100, self.terminator.closeterm, self)
return (-1) return (-1)
if not args: if not args:
args.append (shell) args.append (shell)
os.putenv ('WINDOWID', '%s'%self._vte.get_parent_window().xid)
self._pid = self._vte.fork_command (command = shell, argv = args, envv = [], directory=self.cwd, loglastlog = login, logwtmp = update_records, logutmp = update_records) self._pid = self._vte.fork_command (command = shell, argv = args, envv = [], directory=self.cwd, loglastlog = login, logwtmp = update_records, logutmp = update_records)
if self._pid == -1: if self._pid == -1:
@ -621,6 +622,7 @@ class Terminator:
self.window.add (term) self.window.add (term)
self.window.show () self.window.show ()
term.spawn_child ()
def maximize (self): def maximize (self):
""" Maximize the Terminator window.""" """ Maximize the Terminator window."""
@ -738,6 +740,7 @@ class Terminator:
pane.show () pane.show ()
pane.set_position (position / 2) pane.set_position (position / 2)
terminal.show () terminal.show ()
terminal.spawn_child ()
# insert the term reference into the list # insert the term reference into the list
index = self.term_list.index (widget) index = self.term_list.index (widget)