Guake / guake

Drop-down terminal for GNOME
https://guake.github.io
GNU General Public License v2.0
4.37k stars 577 forks source link

Fix save content with newer Vte #2218

Open smith-doug opened 6 months ago

smith-doug commented 6 months ago

Fixes Save Content feature with newer versions of Vte. The entire contents, including scrollback, will be saved.

See #1958 I left the old method there as well, in case get_text_range doesn't work for some reason. I don't have a system with an older version of Vte to test.

Davidy22 commented 1 month ago

Sorry about the slow reply, been bogged down for a bit. Built and ran, and I get the following traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/guake/callbacks.py", line 39, in on_save_to_file
    SaveTerminalDialog(self.terminal, self.window).run()
  File "/usr/lib/python3.12/site-packages/guake/dialogs.py", line 153, in run
    selection = content[0].rstrip().lstrip()
                ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rstrip'

My terminal I presume is an older version of VTE because I'm able to use save content for the full terminal history without the patch. I suspect that the condition in the if statement reliant on get_text_range() may need to be reworked.