From 75f4abba490c95aa451a754015a97c3e7fd2d7e2 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 13 Feb 2017 17:30:37 +0100 Subject: [PATCH] Fix custom_command and always_split_with_profile to work together (Nix) --- terminatorlib/notebook.py | 8 ++++++-- terminatorlib/paned.py | 4 +++- terminatorlib/window.py | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index b258c47a..8cfe269c 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -162,10 +162,12 @@ class Notebook(Container, Gtk.Notebook): if not sibling: sibling = maker.make('terminal') sibling.set_cwd(cwd) + if self.config['always_split_with_profile']: + sibling.force_set_profile(None, widget.get_profile()) sibling.spawn_child() if widget.group and self.config['split_to_group']: sibling.set_group(None, widget.group) - if self.config['always_split_with_profile']: + elif self.config['always_split_with_profile']: sibling.force_set_profile(None, widget.get_profile()) self.insert_page(container, None, page_num) @@ -245,8 +247,10 @@ class Notebook(Container, Gtk.Notebook): widget = maker.make('Terminal') if cwd: widget.set_cwd(cwd) + if profile and self.config['always_split_with_profile']: + widget.force_set_profile(None, profile) widget.spawn_child(debugserver=debugtab) - if profile and self.config['always_split_with_profile']: + elif profile and self.config['always_split_with_profile']: widget.force_set_profile(None, profile) signals = {'close-term': self.wrapcloseterm, diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index cc2bc59a..0e6f4a20 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -51,10 +51,12 @@ class Paned(Container): if not sibling: sibling = self.maker.make('terminal') sibling.set_cwd(cwd) + if self.config['always_split_with_profile']: + sibling.force_set_profile(None, widget.get_profile()) sibling.spawn_child() if widget.group and self.config['split_to_group']: sibling.set_group(None, widget.group) - if self.config['always_split_with_profile']: + elif self.config['always_split_with_profile']: sibling.force_set_profile(None, widget.get_profile()) self.add(container) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index d2e558d3..6ab38461 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -468,10 +468,12 @@ class Window(Container, Gtk.Window): if not sibling: sibling = maker.make('Terminal') sibling.set_cwd(cwd) + if self.config['always_split_with_profile']: + sibling.force_set_profile(None, widget.get_profile()) sibling.spawn_child() if widget.group and self.config['split_to_group']: sibling.set_group(None, widget.group) - if self.config['always_split_with_profile']: + elif self.config['always_split_with_profile']: sibling.force_set_profile(None, widget.get_profile()) self.add(container)