From 8c45d9730422202361bda17e09ad79a527d9eb20 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 30 Nov 2015 16:19:41 +0100 Subject: [PATCH 1/6] Fix rotate terminals under tabs, and (gtk3-only) focus loss on rotate --- terminatorlib/window.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 540541b8..772024a4 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -535,9 +535,15 @@ class Window(Container, Gtk.Window): maker = Factory() # collect all paned children in breadth-first order paned = [] - for child in self.get_children(): - if maker.isinstance(child, 'Paned'): - paned.append(child) + child = self.get_child() + + # If our child is a Notebook, reset to work from its visible child + if maker.isinstance(child, 'Notebook'): + pagenum = child.get_current_page() + child = child.get_nth_page(pagenum) + + if maker.isinstance(child, 'Paned'): + paned.append(child) for p in paned: for child in p.get_children(): if child not in paned and maker.isinstance(child, 'Paned'): @@ -546,10 +552,10 @@ class Window(Container, Gtk.Window): for p in paned: p.rotate(widget, clockwise) self.show_all() - widget.grab_focus() - + while Gtk.events_pending(): Gtk.main_iteration_do(False) + widget.grab_focus() self.set_pos_by_ratio = False def get_visible_terminals(self): From 42f2dd31c86d5907c3e85904788c2da1c555b512 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 30 Nov 2015 17:39:38 +0100 Subject: [PATCH 2/6] Change the scroll_on_output default to false --- doc/terminator_config.5 | 2 +- terminatorlib/config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index f4fbc015..a816afdf 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -416,7 +416,7 @@ Default value: \fBTrue\fR .TP .B scroll_on_keystroke \fR(boolean) If true, pressing a key jumps the scrollbar to the bottom. -Default value: \fBTrue\fR +Default value: \fBFalse\fR .TP .B scroll_on_output \fR(boolean) If true, whenever there's new output the terminal will scroll to the bottom. diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 7fbec4e8..885f943f 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -220,7 +220,7 @@ DEFAULTS = { 'scrollbar_position' : "right", 'scroll_background' : True, 'scroll_on_keystroke' : True, - 'scroll_on_output' : True, + 'scroll_on_output' : False, 'scrollback_lines' : 500, 'scrollback_infinite' : False, 'exit_action' : 'close', From d3a0d5193ee7cba202506e26daa0a6707cfc9858 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 30 Nov 2015 19:07:43 +0100 Subject: [PATCH 3/6] Remove unsupported utmp for now, till alternative solution --- terminatorlib/config.py | 1 - terminatorlib/preferences.glade | 40 +++++++++------------------------ terminatorlib/prefseditor.py | 8 ------- terminatorlib/terminal.py | 2 -- 4 files changed, 11 insertions(+), 40 deletions(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 885f943f..930b30b6 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -229,7 +229,6 @@ DEFAULTS = { #729fcf:#ad7fa8:#34e2e2:#eeeeec', 'word_chars' : ',./?%&#:_', 'mouse_autohide' : True, - 'update_records' : True, 'login_shell' : False, 'use_custom_command' : False, 'custom_command' : '', diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade index 8159eabb..533e6b62 100644 --- a/terminatorlib/preferences.glade +++ b/terminatorlib/preferences.glade @@ -1962,7 +1962,7 @@ True False - 5 + 4 2 12 6 @@ -1982,24 +1982,6 @@ - - - _Update login records when command is launched - True - True - False - False - True - True - - - - 2 - 1 - 2 - - - Ru_n a custom command instead of my shell @@ -2013,8 +1995,8 @@ 2 - 2 - 3 + 1 + 2 @@ -2029,8 +2011,8 @@ custom_command_entry - 3 - 4 + 2 + 3 GTK_FILL @@ -2046,8 +2028,8 @@ exit_action_combobox - 4 - 5 + 3 + 4 GTK_FILL @@ -2067,8 +2049,8 @@ 1 2 - 3 - 4 + 2 + 3 @@ -2089,8 +2071,8 @@ 1 2 - 4 - 5 + 3 + 4 diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 02de5775..09706c27 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -454,9 +454,6 @@ class PrefsEditor: # Login shell widget = guiget('login_shell_checkbutton') widget.set_active(self.config['login_shell']) - # Login records - widget = guiget('update_records_checkbutton') - widget.set_active(self.config['update_records']) # Use Custom command widget = guiget('use_custom_command_checkbutton') widget.set_active(self.config['use_custom_command']) @@ -740,11 +737,6 @@ class PrefsEditor: self.config['login_shell'] = widget.get_active() self.config.save() - def on_update_records_checkbutton_toggled(self, widget): - """Update records setting changed""" - self.config['update_records'] = widget.get_active() - self.config.save() - def on_scroll_background_checkbutton_toggled(self, widget): """Scroll background setting changed""" self.config['scroll_background'] = widget.get_active() diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 71696e49..722dbf6b 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1334,8 +1334,6 @@ class Terminal(Gtk.VBox): self.cwd = cwd def spawn_child(self, widget=None, respawn=False, debugserver=False): - update_records = self.config['update_records'] - login = self.config['login_shell'] args = [] shell = None command = None From cd68c0e264c281efde4f267b03b1725224ba4cad Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 30 Nov 2015 19:08:04 +0100 Subject: [PATCH 4/6] Fix the "Run command as login shell" --- terminatorlib/terminal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 722dbf6b..a96a7979 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1405,11 +1405,12 @@ class Terminal(Gtk.VBox): envv.append('TERMINATOR_DBUS_PATH=%s' % self.terminator.dbus_path) dbg('Forking shell: "%s" with args: %s' % (shell, args)) + args.insert(0, shell) result, self.pid = self.vte.spawn_sync(Vte.PtyFlags.DEFAULT, self.cwd, args, envv, - GLib.SpawnFlags.DO_NOT_REAP_CHILD, + GLib.SpawnFlags.FILE_AND_ARGV_ZERO | GLib.SpawnFlags.DO_NOT_REAP_CHILD, None, None, None) From 712ed28d699e423086f7e3ad61b232848b5d1712 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Tue, 1 Dec 2015 01:07:09 +0100 Subject: [PATCH 5/6] Correct documentation error in rev 1646 --- doc/terminator_config.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/terminator_config.5 b/doc/terminator_config.5 index a816afdf..7bb22a17 100644 --- a/doc/terminator_config.5 +++ b/doc/terminator_config.5 @@ -416,11 +416,11 @@ Default value: \fBTrue\fR .TP .B scroll_on_keystroke \fR(boolean) If true, pressing a key jumps the scrollbar to the bottom. -Default value: \fBFalse\fR +Default value: \fBTrue\fR .TP .B scroll_on_output \fR(boolean) If true, whenever there's new output the terminal will scroll to the bottom. -Default value: \fBTrue\fR +Default value: \fBFalse\fR .TP .B scrollback_lines Number of scrollback lines to keep around. You can scroll back in the terminal by this number of lines; lines that don't fit in the scrollback are discarded. Warning: with large values, rewrapping on resize might be slow. From 501e7c5e1a9ff1cfb3d803e74a387ee81a260518 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Tue, 1 Dec 2015 02:16:53 +0100 Subject: [PATCH 6/6] Minor followup to rotate focus loss - probably no effect --- terminatorlib/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 772024a4..dddd503f 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -479,10 +479,10 @@ class Window(Container, Gtk.Window): for term in order: container.add(term) container.show_all() - sibling.grab_focus() while Gtk.events_pending(): Gtk.main_iteration_do(False) + sibling.grab_focus() self.set_pos_by_ratio = False