diff options
author | Wade Brainerd <wadetb@gmail.com> | 2010-01-17 02:34:26 (GMT) |
---|---|---|
committer | Wade Brainerd <wadetb@gmail.com> | 2010-01-17 02:34:26 (GMT) |
commit | 7af1f7d3f7412f5dc6fd3f048149e9503e57c05a (patch) | |
tree | 9f9a2d89c13143dd18063fcd589b8e2f1496d702 /terminal.py | |
parent | f0a2757a23eba39191a0605ac249d698ade5c3b9 (diff) | |
parent | fb87471c7e0fd6a95f214e2fbfa2f59e16b30aac (diff) |
Merge branch 'master' of git://git.sugarlabs.org/terminal/mainline
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 0e9a818..a0f97ba 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']: |