From 0e20e435f4bf00745143a0aef0c2118bae1738be Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 19 May 2008 23:05:10 +0100 Subject: [PATCH 1/2] don't set when it's empty --- terminator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminator b/terminator index f1370743..6d0181a4 100755 --- a/terminator +++ b/terminator @@ -145,7 +145,7 @@ class TerminatorTerm (gtk.VBox): self.add_matches() env_proxy = os.getenv ('http_proxy') - if not env_proxy: + if not env_proxy and self.conf.http_proxy: os.putenv ('http_proxy', self.conf.http_proxy) if self.spawn_child () == -1: From 8d1209ac0d314c2c28a637a004cc6af57a675a09 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 20 May 2008 00:46:34 +0100 Subject: [PATCH 2/2] move child spawning outside TerminatorTerm.__init__ mainly so we can set WINDOWID for children --- terminator | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/terminator b/terminator index 6d0181a4..29e10695 100755 --- a/terminator +++ b/terminator @@ -148,9 +148,7 @@ class TerminatorTerm (gtk.VBox): if not env_proxy and self.conf.http_proxy: os.putenv ('http_proxy', self.conf.http_proxy) - if self.spawn_child () == -1: - # We failed to usefully create a child shell, we need to kill ourself - gobject.timeout_add (100, self.terminator.closeterm, self) + os.putenv ('COLORTERM', 'gnome-terminal') def add_matches (self, lboundry="[[:<:]]", rboundry="[[:>:]]"): userchars = "-A-Za-z0-9" @@ -204,11 +202,14 @@ class TerminatorTerm (gtk.VBox): if not os.path.exists (shell): # Give up, we're completely stuck print >> sys.stderr, _('Unable to find a shell') + gobject.timeout_add (100, self.terminator.closeterm, self) return (-1) if not args: 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) if self._pid == -1: @@ -621,6 +622,7 @@ class Terminator: self.window.add (term) self.window.show () + term.spawn_child () def maximize (self): """ Maximize the Terminator window.""" @@ -738,6 +740,7 @@ class Terminator: pane.show () pane.set_position (position / 2) terminal.show () + terminal.spawn_child () # insert the term reference into the list index = self.term_list.index (widget)