diff --git a/terminatorlib/cwd.py b/terminatorlib/cwd.py index b3d39a01..b4c87a9e 100755 --- a/terminatorlib/cwd.py +++ b/terminatorlib/cwd.py @@ -5,9 +5,16 @@ import platform import os +import pwd from util import dbg -def get_pidcwd(): +def get_default_cwd(): + """Determine a reasonable default cwd""" + cwd = os.getcwd() + if not os.path.exists(cwd) or not os.path.isdir(cwd): + cwd = pwd.getpwuid(os.getuid())[5] + +def get_pid_cwd(): """Determine an appropriate cwd function for the OS we are running on""" func = lambda pid: None diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index d94ee9cf..a4cfa91d 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -4,7 +4,6 @@ """terminal.py - classes necessary to provide Terminal widgets""" import sys - import pygtk pygtk.require('2.0') import gobject @@ -22,6 +21,8 @@ except ImportError: ERROR.run() sys.exit(1) +from cwd import get_pid_cwd, get_default_cwd + class Terminal(gtk.VBox): """Class implementing the VTE widget and its wrappings""" @@ -32,5 +33,8 @@ class Terminal(gtk.VBox): gtk.VBox.__init__(self) self.vte = vte.Terminal() + self.vte.set_size(80, 24) + self.vte._expose_data = None + self.vte.show() # vim: set expandtab ts=4 sw=4: