diff --git a/terminator b/terminator index feb34fcf..dc3ef747 100755 --- a/terminator +++ b/terminator @@ -19,6 +19,8 @@ """Terminator by Chris Jones """ import sys +import os +ORIGCWD = os.getcwd() # Check we have simple basics like Gtk+ and a valid $DISPLAY try: @@ -50,6 +52,7 @@ if __name__ == '__main__': MAKER = Factory() TERMINATOR = Terminator() + TERMINATOR.origcwd = ORIGCWD TERMINATOR.reconfigure() TERMINATOR.new_window() diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index c3110094..e1719baa 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -76,6 +76,7 @@ class Terminal(gtk.VBox): group = None cwd = None + origcwd = None command = None clipboard = None pid = None @@ -109,6 +110,7 @@ class Terminal(gtk.VBox): self.config = Config() self.cwd = get_default_cwd() + self.origcwd = self.terminator.origcwd self.clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD) self.vte = vte.Terminal() @@ -1301,11 +1303,14 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) self.emit('ungroup-tab') def key_new_window(self): + self.terminator.new_window() + + def key_new_terminator(self): cmd = sys.argv[0] if not os.path.isabs(cmd): # Command is not an absolute path. Figure out where we are - cmd = os.path.join (self.cwd, sys.argv[0]) + cmd = os.path.join (self.origcwd, sys.argv[0]) if not os.path.isfile(cmd): # we weren't started as ./terminator in a path. Give up err('Terminal::key_new_window: Unable to locate Terminator') diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 17f10223..99c64ae4 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -21,6 +21,8 @@ class Terminator(Borg): config = None keybindings = None + origcwd = None + groupsend = None groupsend_type = {'all':0, 'group':1, 'off':2}