diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index bef0caf9..da8b2fd2 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -195,7 +195,7 @@ class Notebook(Container, gtk.Notebook): children.append(self.get_nth_page(page)) return(children) - def newtab(self, debugtab=False, widget=None, cwd=None, metadata=None): + def newtab(self, debugtab=False, widget=None, cwd=None, metadata=None, profile=None): """Add a new tab, optionally supplying a child widget""" dbg('making a new tab') maker = Factory() @@ -256,6 +256,8 @@ class Notebook(Container, gtk.Notebook): self.show_all() if maker.isinstance(widget, 'Terminal'): widget.grab_focus() + if profile: + widget.force_set_profile(None, profile) def wrapcloseterm(self, widget): """A child terminal has closed""" diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index 2349a529..44abe25b 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -60,6 +60,8 @@ class Paned(Container): sibling = self.maker.make('terminal') sibling.set_cwd(cwd) sibling.spawn_child() + if sibling: + sibling.force_set_profile(None, widget.get_profile()) self.add(container) self.show_all() diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 8fb4fbf7..da1b2544 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -219,6 +219,7 @@ class Window(Container, gtk.Window): def tab_new(self, widget=None, debugtab=False, _param1=None, _param2=None): """Make a new tab""" cwd = None + profile = None if self.get_property('term_zoomed') == True: err("You can't create a tab while a terminal is maximised/zoomed") @@ -226,11 +227,13 @@ class Window(Container, gtk.Window): if widget: cwd = widget.get_cwd() + profile = widget.get_profile() + maker = Factory() if not self.is_child_notebook(): dbg('Making a new Notebook') notebook = maker.make('Notebook', window=self) - self.get_child().newtab(debugtab, cwd=cwd) + self.get_child().newtab(debugtab, cwd=cwd, profile=profile) def on_delete_event(self, window, event, data=None): """Handle a window close request""" @@ -425,6 +428,9 @@ class Window(Container, gtk.Window): sibling = maker.make('Terminal') sibling.set_cwd(cwd) sibling.spawn_child() + if sibling: + sibling.force_set_profile(None, widget.get_profile()) + self.add(container) container.show_all()