Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix save content with newer Vte #2218

Merged
merged 3 commits into from
Dec 18, 2024
Merged

Conversation

smith-doug
Copy link
Contributor

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
Copy link
Collaborator

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.

guake/dialogs.py Outdated Show resolved Hide resolved
PhungXuanAnh added a commit to PhungXuanAnh/guake that referenced this pull request Nov 26, 2024
PhungXuanAnh added a commit to PhungXuanAnh/guake that referenced this pull request Nov 26, 2024
Copy link
Collaborator

@Davidy22 Davidy22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch looks like it works now, but there's some unfortunate behavior with the way this interacts with the hide on focus loss option. It seems like a common issue across everything that pops a dialog, maybe we need a utlity wrapper for dialogs that'll temporarily disable hide on lose focus. That'd be out of scope for this PR though, merging this.

@Davidy22 Davidy22 merged commit 0eba0bb into Guake:master Dec 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants