Fix profile re-use when opening new window

This commit is contained in:
Stephen Boddy 2015-12-02 20:57:59 +01:00
parent 9c21b835c2
commit fc6e3e7e65
2 changed files with 4 additions and 2 deletions

View File

@ -1815,7 +1815,7 @@ class Terminal(Gtk.VBox):
self.emit('ungroup-tab') self.emit('ungroup-tab')
def key_new_window(self): def key_new_window(self):
self.terminator.new_window(self.get_cwd()) self.terminator.new_window(self.get_cwd(), self.get_profile())
def key_new_tab(self): def key_new_tab(self):
self.get_toplevel().tab_new(self) self.get_toplevel().tab_new(self)

View File

@ -201,13 +201,15 @@ class Terminator(Borg):
return terminal return terminal
return None return None
def new_window(self, cwd=None): def new_window(self, cwd=None, profile=None):
"""Create a window with a Terminal in it""" """Create a window with a Terminal in it"""
maker = Factory() maker = Factory()
window = maker.make('Window') window = maker.make('Window')
terminal = maker.make('Terminal') terminal = maker.make('Terminal')
if cwd: if cwd:
terminal.set_cwd(cwd) terminal.set_cwd(cwd)
if profile and self.config['always_split_with_profile']:
terminal.force_set_profile(None, profile)
window.add(terminal) window.add(terminal)
window.show(True) window.show(True)
terminal.spawn_child() terminal.spawn_child()