Commited as:<br><a href="http://git.sugarlabs.org/terminal/mainline/commit/5bff52765091225a1ef4095812064337c0b48dd3">http://git.sugarlabs.org/terminal/mainline/commit/5bff52765091225a1ef4095812064337c0b48dd3</a><br><br>Cheers.<br>

<br>2012/6/4 S. Daniel Francis <<a href="mailto:francis@sugarlabs.org">francis@sugarlabs.org</a>>:<br>> This patch is temporary until we solve the problem with the method<br>> Vte.Terminal.get_text<br>><br>

> Signed-off-by: Daniel Francis <<a href="mailto:francis@sugarlabs.org">francis@sugarlabs.org</a>><br>> ---<br>>  terminal.py |   65 ++++++++++++++++++++++++++++++-----------------------------<br>>  1 file changed, 33 insertions(+), 32 deletions(-)<br>

><br>> diff --git a/terminal.py b/terminal.py<br>> index 6918e3f..16d39f5 100644<br>> --- a/terminal.py<br>> +++ b/terminal.py<br>> @@ -467,38 +467,39 @@ class TerminalActivity(activity.Activity):<br>>             self._next_tab_button.props.sensitive = True<br>

><br>>     def write_file(self, file_path):<br>> -        if not self.metadata['mime_type']:<br>> -            self.metadata['mime_type'] = 'text/plain'<br>> -<br>> -        data = {}<br>

> -        data['current-tab'] = self._notebook.get_current_page()<br>> -        data['tabs'] = []<br>> -<br>> -        for i in range(self._notebook.get_n_pages()):<br>> -            page = self._notebook.get_nth_page(i)<br>

> -<br>> -            def selected_cb(terminal, c, row, cb_data):<br>> -                return 1<br>> -            scrollback_text = page.vt.get_text(selected_cb, False)<br>> -<br>> -            scrollback_lines = scrollback_text.split('\n')<br>

> -<br>> -            # Note- this currently gets the child's initial environment<br>> -            # rather than the current environment, making it not very useful.<br>> -            environment = open('/proc/%d/environ' %<br>

> -                               page.pid, 'r').read().split('\0')<br>> -<br>> -            cwd = os.readlink('/proc/%d/cwd' % page.pid)<br>> -<br>> -            tab_state = {'env': environment, 'cwd': cwd,<br>

> -                         'scrollback': scrollback_lines}<br>> -<br>> -            data['tabs'].append(tab_state)<br>> -<br>> -        fd = open(file_path, 'w')<br>> -        text = simplejson.dumps(data)<br>

> -        fd.write(text)<br>> -        fd.close()<br>> +        return<br>> +#        if not self.metadata['mime_type']:<br>> +#            self.metadata['mime_type'] = 'text/plain'<br>

> +#<br>> +#        data = {}<br>> +#        data['current-tab'] = self._notebook.get_current_page()<br>> +#        data['tabs'] = []<br>> +#<br>> +#        for i in range(self._notebook.get_n_pages()):<br>

> +#            page = self._notebook.get_nth_page(i)<br>> +#<br>> +#            def selected_cb(terminal, c, row, cb_data):<br>> +#                return 1<br>> +#            scrollback_text = page.vt.get_text(selected_cb, False)<br>

> +#<br>> +#            scrollback_lines = scrollback_text.split('\n')<br>> +#<br>> +#            # Note- this currently gets the child's initial environment<br>> +#            # rather than the current environment, making it not very useful.<br>

> +#            environment = open('/proc/%d/environ' %<br>> +#                               page.pid, 'r').read().split('\0')<br>> +#<br>> +#            cwd = os.readlink('/proc/%d/cwd' % page.pid)<br>

> +#<br>> +#            tab_state = {'env': environment, 'cwd': cwd,<br>> +#                         'scrollback': scrollback_lines}<br>> +#<br>> +#            data['tabs'].append(tab_state)<br>

> +#<br>> +#        fd = open(file_path, 'w')<br>> +#        text = simplejson.dumps(data)<br>> +#        fd.write(text)<br>> +#        fd.close()<br>><br>>     def _get_conf(self, conf, var, default):<br>

>         if conf.has_option('terminal', var):<br>> --<br>> 1.7.10.2<br><br>