Preserve cwd into new windows. Closes LP #597651

This commit is contained in:
Chris Jones 2010-07-03 16:16:50 +01:00
parent 838d27bb60
commit 581a738c62
2 changed files with 4 additions and 2 deletions

View File

@ -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]

View File

@ -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()