From 581a738c62ded9e6434fe44fcc901b4953fe5428 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 3 Jul 2010 16:16:50 +0100 Subject: [PATCH] Preserve cwd into new windows. Closes LP #597651 --- terminatorlib/terminal.py | 2 +- terminatorlib/terminator.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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()