diff options
author | Martin Langhoff <martin.langhoff@gmail.com> | 2009-11-08 20:03:10 (GMT) |
---|---|---|
committer | Sayamindu Dasgupta <sayamindu@gmail.com> | 2009-11-08 20:03:10 (GMT) |
commit | 3ffaf38655b4abaf9a4df738b735144befc69d3b (patch) | |
tree | 7b9bd7ba0a75ce7c9c396e07a23c01ddc0573b8b /terminal.py | |
parent | c6be19ffc3f4c5d22d1aed99851abdf11e651ee8 (diff) |
Fix failure to start if older CWD is missing
Diffstat (limited to 'terminal.py')
-rw-r--r-- | terminal.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/terminal.py b/terminal.py index 9232545..bc433f3 100644 --- a/terminal.py +++ b/terminal.py @@ -17,6 +17,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os +import sys import simplejson import ConfigParser import logging @@ -293,8 +294,12 @@ class TerminalActivity(activity.Activity): # os.environ['TERMINAL_ENV'] = '\n'.join(filtered_env) # Restore the working directory. - if 'cwd' in tab_state: - os.chdir(tab_state['cwd']) + if 'cwd' in tab_state and os.path.exists(tab_state['cwd']): + try: + os.chdir(tab_state['cwd']) + except: + # ACLs may deny access + sys.stdout.write("Could not chdir to " + tab_state['cwd']) # Restore the scrollback buffer. for l in tab_state['scrollback']: |