diff --git a/terminator b/terminator index 671a4e88..2c7f1918 100755 --- a/terminator +++ b/terminator @@ -52,7 +52,7 @@ if __name__ == '__main__': MAKER = Factory() TERMINATOR = Terminator() - TERMINATOR.origcwd = ORIGCWD + TERMINATOR.set_origcwd(ORIGCWD) TERMINATOR.reconfigure() try: TERMINATOR.create_layout(OPTIONS.layout) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 34726cba..e910026b 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -4,6 +4,7 @@ """terminator.py - class for the master Terminator singleton""" import copy +import os import gtk from borg import Borg @@ -63,6 +64,13 @@ class Terminator(Borg): if self.gnome_client is None: self.attempt_gnome_client() + def set_origcwd(self, cwd): + """Store the original cwd our process inherits""" + if cwd == '/': + cwd = os.path.expanduser('~') + os.chdir(cwd) + self.origcwd = cwd + def attempt_gnome_client(self): """Attempt to find a GNOME Session to register with""" try: