Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWade Brainerd <wadetb@gmail.com>2009-02-26 19:32:44 (GMT)
committer Wade Brainerd <wadetb@gmail.com>2009-02-26 19:32:44 (GMT)
commite973a1f4fe2070b9c6d01346b30921488496bc8f (patch)
tree57d70db4f3a6cef099cc3cd6198547f28b589228
parent9c73df2bec29b63b3a407fd83be47e974a401a49 (diff)
Persistent terminal WIP.
-rw-r--r--terminal.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/terminal.py b/terminal.py
index 036a52c..ec7c899 100644
--- a/terminal.py
+++ b/terminal.py
@@ -206,11 +206,10 @@ class TerminalActivity(sugar.activity.activity.Activity):
if tab_state:
# Restore the environment.
- env = tab_state['env'].replace('\0', '\n')
- vt.feed(env)
+ env = tab_state['env']
filtered_vars = []
- for e in env.split('\n'):
+ for e in env:
var, sep, value = e.partition('=')
if var not in MASKED_ENVIRONMENT:
filtered_vars.append(var + sep + value)
@@ -218,6 +217,7 @@ class TerminalActivity(sugar.activity.activity.Activity):
# Restore working directory.
vt.feed(var + ' = ' + value + '\r\n')
if var == 'PWD':
+ vt.feed('chdir '+ value + '\r\n')
os.chdir(value)
# TODO: Make the shell restore these environment variables, then clear out TERMINAL_ENV.
@@ -300,7 +300,7 @@ class TerminalActivity(sugar.activity.activity.Activity):
scrollback_lines = scrollback_text.split('\n')
- environment = open('/proc/%d/environ' % page.pid, 'r').read().replace('\0', '\n')
+ environment = open('/proc/%d/environ' % page.pid, 'r').read().split('\0')
tab_state = { 'env': environment, 'cwd': '', 'scrollback': scrollback_lines }