diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 06042a80..cc258f20 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1482,7 +1482,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) self.emit('ungroup-tab') def key_new_window(self): - self.terminator.new_window() + self.terminator.new_window(self.terminator.pid_cwd(self.pid)) def key_new_terminator(self): cmd = sys.argv[0] diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 9edf7027..16860068 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -139,11 +139,13 @@ class Terminator(Borg): dbg('Terminator::deregister_terminal: %d terminals remain' % len(self.terminals)) - def new_window(self): + def new_window(self, cwd=None): """Create a window with a Terminal in it""" maker = Factory() window = maker.make('Window') terminal = maker.make('Terminal') + if cwd: + terminal.set_cwd(cwd) window.add(terminal) window.show() terminal.spawn_child()