From cab064d5585567538d8019a149d000d933657dc8 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 19 Feb 2008 00:13:51 +0000 Subject: [PATCH 1/9] changelog the previous fixes --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 74efa04e..660a1988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ terminator 0.8.1: * Fixed ChangeLog * Revert URI matching behaviour to the same as gnome-terminal + * Close LP #179315 with a fuller fix that provides proper colour support terminator 0.8: * Make dependency on python-gnome optional. Non-gnome users can now reap From bd36c9e545904bffb84826d9217e3eb878d204d2 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 19 Feb 2008 23:50:08 +0000 Subject: [PATCH 2/9] The schema for this seems to change, so let's accept these as equal values --- terminator | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminator b/terminator index c398063f..0fb130f4 100755 --- a/terminator +++ b/terminator @@ -135,7 +135,7 @@ class TerminatorTerm: self._box.show () self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ()) - if self.scrollbar_position != "hidden": + if self.scrollbar_position != "hidden" and self.scrollbar_position != "disabled": self._scrollbar.show () if self.scrollbar_position == 'right': @@ -305,7 +305,7 @@ class TerminatorTerm: scrollbar_position = self.reconf ('scrollbar_position') if scrollbar_position != self.scrollbar_position: - if scrollbar_position == 'hidden': + if scrollbar_position == 'hidden' or scrollbar_position == 'disabled': self._scrollbar.hide () else: self._scrollbar.show () From 53102e1504a0e8f6a276ab4705b8080c8ab7668f Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 19 Feb 2008 23:53:52 +0000 Subject: [PATCH 3/9] latest es translation from LP --- po/es.po | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/po/es.po b/po/es.po index 886a31c3..844d4e64 100644 --- a/po/es.po +++ b/po/es.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-01-29 23:57+0000\n" -"PO-Revision-Date: 2008-01-15 00:09+0000\n" +"PO-Revision-Date: 2008-02-15 14:25+0000\n" "Last-Translator: Nicolas Valcárcel \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2008-02-14 23:16+0000\n" +"X-Launchpad-Export-Date: 2008-02-19 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: terminator:44 @@ -22,23 +22,30 @@ msgid "" "You need to install the python bindings for gobject, gtk, gconf and pango to " "run Terminator." msgstr "" +"Necesitas instalar los lazos python para gobject, gtk, gconf y pango para " +"ejecutar Terminator" #: terminator:63 msgid "" "You need to install python bindings for libvte (\"python-vte\" in " "debian/ubuntu)" msgstr "" +"Necesitas instalar lazos python para libvte (\"python-vte\" en debian/ubuntu)" #: terminator:127 #, python-format msgid "Warning: unable to find profile %s. Continue with default values..." msgstr "" +"Advertencia: No es posible encontrar perfil %s. Continuar con valores por " +"defecto..." #: terminator:213 msgid "" "Unknown value requested. Unable to find in gconf profile or default " "settings: " msgstr "" +"Valor desconocido requerido. No se pudo encontrar en perfil gconf o valores " +"por defecto " #: terminator:414 msgid "_Open Link" From 64702114268d035965a1dadb0a09abbb708b8ee8 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 20 Feb 2008 00:07:34 +0000 Subject: [PATCH 4/9] blah, tab space nonsense --- ChangeLog | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 660a1988..3939c212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,18 @@ terminator 0.8.1: - * Fixed ChangeLog - * Revert URI matching behaviour to the same as gnome-terminal - * Close LP #179315 with a fuller fix that provides proper colour support + * Fixed ChangeLog + * Revert URI matching behaviour to the same as gnome-terminal + * Close LP #179315 with a fuller fix that provides proper colour support terminator 0.8: - * Make dependency on python-gnome optional. Non-gnome users can now reap - the glorious benefits of Terminator and will only lose the ability to - open email URLs (assuming their browser won't handle this for them). - Closes LP #184809 + * Make dependency on python-gnome optional. Non-gnome users can now reap + the glorious benefits of Terminator and will only lose the ability to + open email URLs (assuming their browser won't handle this for them). + Closes LP #184809 * Remove blank translations from .desktop file to fix empty menu entries. - Closes LP #187187 + Closes LP #187187 * Add application icon at various sizes including a window icon - * New options parser allowing -x support. Closes LP191124 - * More translations (thanks!) + * New options parser allowing -x support. Closes LP191124 + * More translations (thanks!) terminator 0.7: From 379be85a0958b56d4557e1b6ae49b1536b2ca753 Mon Sep 17 00:00:00 2001 From: Thomas Meire Date: Sat, 23 Feb 2008 22:54:39 +0100 Subject: [PATCH 5/9] Add support for real transparency when using a composited environment. (Fixes LP #190946) --- terminator | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/terminator b/terminator index 0d2b9cfc..f1397a14 100755 --- a/terminator +++ b/terminator @@ -291,8 +291,12 @@ class TerminatorTerm: self._vte.set_scroll_background (self.reconf ('scroll_background')) self._vte.set_background_transparent (False) if background_type == "transparent": - self._vte.set_background_transparent (True) - self._vte.set_background_saturation (1 - (self.reconf ('background_darkness'))) + darkness = self.reconf ('background_darkness') + if self._vte.is_composited(): + self._vte.set_opacity(int(darkness * 65535)) + else: + self._vte.set_background_transparent (True) + self._vte.set_background_saturation (1 - darkness) colors = palette.split (':') palette = [] @@ -540,6 +544,13 @@ class Terminator: self.window.set_property ('allow-shrink', True) + # Set RGBA colormap if possible so VTE can use real alpha + # channels for transparency. + screen = self.window.get_screen() + colormap = screen.get_rgba_colormap() + if colormap and self.window.is_composited(): + self.window.set_colormap(colormap) + # Start out with just one terminal # FIXME: This should be really be decided from some kind of profile term = (TerminatorTerm (self, self.profile, self.command)) From 4c35d98cade329ba03aeec0f389b999cc0213e5a Mon Sep 17 00:00:00 2001 From: Thomas Meire Date: Sun, 24 Feb 2008 17:44:51 +0100 Subject: [PATCH 6/9] Switch transparency-mode when compositing is turned off or on. (Addition to the fix for LP #190946) --- terminator | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/terminator b/terminator index f1397a14..e58547ee 100755 --- a/terminator +++ b/terminator @@ -161,6 +161,7 @@ class TerminatorTerm: self._vte.connect ("key-press-event", self.on_vte_key_press) self._vte.connect ("button-press-event", self.on_vte_button_press) self._vte.connect ("popup-menu", self.on_vte_popup_menu) + self._vte.connect ("composited-changed", self.on_composited_changed) # self._vte.connect ("window-title-changed", self.on_vte_title_change) exit_action = self.gconf_client.get_string (self.profile + "/exit_action") @@ -293,6 +294,7 @@ class TerminatorTerm: if background_type == "transparent": darkness = self.reconf ('background_darkness') if self._vte.is_composited(): + self._vte.set_background_transparent (False) self._vte.set_opacity(int(darkness * 65535)) else: self._vte.set_background_transparent (True) @@ -344,6 +346,9 @@ class TerminatorTerm: def on_gconf_notification (self, client, cnxn_id, entry, what): self.reconfigure_vte () + def on_composited_changed (self, widget): + self.reconfigure_vte () + def on_vte_button_press (self, term, event): # Left mouse button should transfer focus to this vte widget if event.button == 1: @@ -548,7 +553,7 @@ class Terminator: # channels for transparency. screen = self.window.get_screen() colormap = screen.get_rgba_colormap() - if colormap and self.window.is_composited(): + if colormap: self.window.set_colormap(colormap) # Start out with just one terminal From 77e424671459a36de7ec339735527fd834b9c3e6 Mon Sep 17 00:00:00 2001 From: Thomas Meire Date: Sun, 24 Feb 2008 23:33:26 +0100 Subject: [PATCH 7/9] Make a new terminal to open in the same cwd as the cwd of the terminal in which the user was working. If no directory was specified (as for the first terminal at startup), the cwd of the parent process will be used. Fixes LP #181194 --- terminator | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/terminator b/terminator index 02a1fdbc..f56ae7bb 100755 --- a/terminator +++ b/terminator @@ -104,14 +104,17 @@ class TerminatorTerm: matches = {} - - def __init__ (self, terminator, profile = None, command = None): + def __init__ (self, terminator, profile = None, command = None, cwd = None): self.defaults['profile_dir'] = self.defaults['_profile_dir']%(self.defaults['gt_dir']) self.terminator = terminator self.gconf_client = gconf.client_get_default () self.command = command + # Open first tab in ~ or in cwd from parent? + #self.cwd = cwd or os.path.expanduser ("~"); + self.cwd = cwd or os.getcwd(); + if profile == None: profile = self.gconf_client.get_string (self.defaults['gt_dir'] + '/global/default_profile') @@ -201,7 +204,14 @@ class TerminatorTerm: shell = pwd.getpwuid (os.getuid ())[6] args = [os.path.basename (shell)] - self._vte.fork_command (command = shell, argv = args, envv = [], 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) + + def get_cwd (self): + """ Return the current working directory of the subprocess. + This function is NOT portable, as it relies on a *nix-specific + path. This won't work on Windows. + """ + return os.path.realpath("/proc/%s/cwd" % self._pid) def reconf (self, property): value = self.gconf_client.get ('%s/%s'%(self.profile, property)) @@ -641,7 +651,7 @@ class Terminator: """ Split the provided widget on the horizontal or vertical axis. """ # create a new terminal and parent pane. - terminal = TerminatorTerm (self, self.profile, None) + terminal = TerminatorTerm (self, self.profile, None, widget.get_cwd()) pane = (vertical) and gtk.VPaned () or gtk.HPaned () # get the parent of the provided terminal From 67fd877d11cb26c36043952c95095aa8e4c32f1c Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 24 Feb 2008 23:46:56 +0000 Subject: [PATCH 8/9] Move child exit behaviour to a properly named config value so it is simplified. Merge in patch from chantra. Closes LP #194771 --- terminator | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/terminator b/terminator index f56ae7bb..e199f1d3 100755 --- a/terminator +++ b/terminator @@ -85,7 +85,7 @@ class TerminatorTerm: 'scroll_on_output' : False, 'scrollback_lines' : 100, 'focus' : 'sloppy', - 'child_restart' : False, + 'exit_action' : 'close', 'palette' : '#000000000000:#CDCD00000000:#0000CDCD0000:#CDCDCDCD0000:#30BF30BFA38E:#A53C212FA53C:#0000CDCDCDCD:#FAFAEBEBD7D7:#404040404040:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#00000000FFFF:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF', 'word_chars' : '-A-Za-z0-9,./?%&#:_', 'mouse_autohide' : True, @@ -168,14 +168,12 @@ class TerminatorTerm: # self._vte.connect ("window-title-changed", self.on_vte_title_change) exit_action = self.gconf_client.get_string (self.profile + "/exit_action") - if not exit_action: - if self.defaults['child_restart']: - exit_action = "restart" - else: - exit_action = "close" + exit_action = self.reconf ("exit_action") if exit_action == "restart": self._vte.connect ("child-exited", self.spawn_child) - if exit_action == "close": + # We need to support "left" because some buggy versions of gnome-terminal + # set it in some situations + if exit_action in ("close", "left"): self._vte.connect ("child-exited", lambda close_term: self.terminator.closeterm (self)) self._vte.add_events (gtk.gdk.ENTER_NOTIFY_MASK) From 2ee1943b4cdafbd35b82341bbf0281721840c7e3 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 25 Feb 2008 00:00:10 +0000 Subject: [PATCH 9/9] Update Thomas Meire's cwd patch so it's clear that it's OS specific, choose a default cwd. LP #181194 --- terminator | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/terminator b/terminator index e199f1d3..7a60e351 100755 --- a/terminator +++ b/terminator @@ -18,7 +18,7 @@ """Terminator by Chris Jones """ # import standard python libs -import os, sys, string, time, math +import os, platform, sys, string, time, math from optparse import OptionParser import gettext @@ -111,8 +111,6 @@ class TerminatorTerm: self.gconf_client = gconf.client_get_default () self.command = command - # Open first tab in ~ or in cwd from parent? - #self.cwd = cwd or os.path.expanduser ("~"); self.cwd = cwd or os.getcwd(); if profile == None: @@ -206,10 +204,17 @@ class TerminatorTerm: def get_cwd (self): """ Return the current working directory of the subprocess. - This function is NOT portable, as it relies on a *nix-specific - path. This won't work on Windows. + This function requires OS specific behaviours """ - return os.path.realpath("/proc/%s/cwd" % self._pid) + system = platform.system () + + if system == 'Linux': + cwd = os.path.realpath ('/proc/%s/cwd' % self._pid) + else: + # We don't have a child cwd getter for this platform, so let + # TerminatorTerm use its default + cwd = None + return (cwd) def reconf (self, property): value = self.gconf_client.get ('%s/%s'%(self.profile, property))