From 4516d991a53d7a3ddc80f1f71076cc1ecca135d5 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 18 Oct 2012 20:51:39 -0700 Subject: [PATCH] Support custom TERM and COLORTERM env vars. Patch from John Feuerstein. Closes LP#794561 --- doc/terminator_config.5 | 8 ++++++++ terminatorlib/config.py | 2 ++ terminatorlib/terminal.py | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index c4637051..d29b4892 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -382,6 +382,14 @@ Default value: \fBblock\fR Sets what type of terminal should be emulated. Default value: \fBxterm\fR .TP +.B xterm +This translates into the value that will be set for TERM in the environment of your terminals. +Default value: \fBxterm\fR +.TP +.B colorterm +This translates into the value that will be set for COLORTERM in the environment of your terminals. +Default value: \fBgnome-terminal\fR +.TP .B use_system_font Whether or not to use the GNOME default monospace font for terminals. Default value: \fBTrue\fR diff --git a/terminatorlib/config.py b/terminatorlib/config.py index ee47416a..52ac74dd 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -186,6 +186,8 @@ DEFAULTS = { 'cursor_shape' : 'block', 'cursor_color' : '#aaaaaa', 'emulation' : 'xterm', + 'term' : 'xterm', + 'colorterm' : 'gnome-terminal', 'font' : 'Mono 10', 'foreground_color' : '#aaaaaa', 'show_titlebar' : True, diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index ba630f34..3a0edf78 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -164,8 +164,8 @@ class Terminal(gtk.VBox): self.connect_signals() - os.putenv('TERM', 'xterm') - os.putenv('COLORTERM', 'gnome-terminal') + os.putenv('TERM', self.config['term']) + os.putenv('COLORTERM', self.config['colorterm']) env_proxy = os.getenv('http_proxy') if not env_proxy: @@ -1278,6 +1278,8 @@ class Terminal(gtk.VBox): pass envv = [] + envv.append('TERM=%s' % self.config['term']) + envv.append('COLORTERM=%s' % self.config['colorterm']) envv.append('TERMINATOR_UUID=%s' % self.uuid.urn) if self.terminator.dbus_name: envv.append('TERMINATOR_DBUS_NAME=%s' % self.terminator.dbus_name)