Fix custom_command and always_split_with_profile to work together (Nix)

This commit is contained in:
Stephen Boddy 2017-02-13 17:30:37 +01:00
parent 8213b828c9
commit 75f4abba49
3 changed files with 12 additions and 4 deletions

View File

@ -162,10 +162,12 @@ class Notebook(Container, Gtk.Notebook):
if not sibling: if not sibling:
sibling = maker.make('terminal') sibling = maker.make('terminal')
sibling.set_cwd(cwd) sibling.set_cwd(cwd)
if self.config['always_split_with_profile']:
sibling.force_set_profile(None, widget.get_profile())
sibling.spawn_child() sibling.spawn_child()
if widget.group and self.config['split_to_group']: if widget.group and self.config['split_to_group']:
sibling.set_group(None, widget.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()) sibling.force_set_profile(None, widget.get_profile())
self.insert_page(container, None, page_num) self.insert_page(container, None, page_num)
@ -245,8 +247,10 @@ class Notebook(Container, Gtk.Notebook):
widget = maker.make('Terminal') widget = maker.make('Terminal')
if cwd: if cwd:
widget.set_cwd(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) 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) widget.force_set_profile(None, profile)
signals = {'close-term': self.wrapcloseterm, signals = {'close-term': self.wrapcloseterm,

View File

@ -51,10 +51,12 @@ class Paned(Container):
if not sibling: if not sibling:
sibling = self.maker.make('terminal') sibling = self.maker.make('terminal')
sibling.set_cwd(cwd) sibling.set_cwd(cwd)
if self.config['always_split_with_profile']:
sibling.force_set_profile(None, widget.get_profile())
sibling.spawn_child() sibling.spawn_child()
if widget.group and self.config['split_to_group']: if widget.group and self.config['split_to_group']:
sibling.set_group(None, widget.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()) sibling.force_set_profile(None, widget.get_profile())
self.add(container) self.add(container)

View File

@ -468,10 +468,12 @@ class Window(Container, Gtk.Window):
if not sibling: if not sibling:
sibling = maker.make('Terminal') sibling = maker.make('Terminal')
sibling.set_cwd(cwd) sibling.set_cwd(cwd)
if self.config['always_split_with_profile']:
sibling.force_set_profile(None, widget.get_profile())
sibling.spawn_child() sibling.spawn_child()
if widget.group and self.config['split_to_group']: if widget.group and self.config['split_to_group']:
sibling.set_group(None, widget.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()) sibling.force_set_profile(None, widget.get_profile())
self.add(container) self.add(container)