<br><br><div class="gmail_quote">On Mon, Jun 4, 2012 at 2:46 PM, S. Daniel Francis <span dir="ltr"><<a href="mailto:francis@sugarlabs.org" target="_blank">francis@sugarlabs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Commited as:<br><a href="http://git.sugarlabs.org/terminal/mainline/commit/5bff52765091225a1ef4095812064337c0b48dd3" target="_blank">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" target="_blank">francis@sugarlabs.org</a>>:<div class="HOEnZb"><div class="h5"><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" target="_blank">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>
</div></div></blockquote></div>Thanks Daniel, I just added a comment on the sources about why we are making this patch.<div><br></div><div><br></div><div>Cheers.</div><div><br></div>