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

Improve Image Support #484

Merged
merged 3 commits into from
Jun 5, 2024
Merged

Conversation

AnonymouX47
Copy link
Contributor

  • Fixes kitty graphics control sequences being displayed in iTerm2's title bar when image support is enabled.
  • Optimizes image class selection.
  • Optimizes image format pixel support detection.

The iTerm2 issue was brought to my attention by @danschwarz in AnonymouX47/term-image#90 (comment):

Interestingly, the window title of the iTerm window has a part of a terminal command sequence in it, not sure what that's about.

The optimization changes were just things I noticed along the way.

- Change: Execute image class selection logic once and cache the result.
- Fix: Force support support only for the selected image format.

  If support is forced for `KittyImage`, then `UrwidImageScreen` will
  emit kitty graphics control sequences to delete images upon starting
  and stoping the screen.

iTerm2 (on Mac OS) doesn't eat up APCs (which kitty graphics control
sequences are) as it should, instead it writes them to the screen
and/or to its title bar.
Copy link
Collaborator

@danschwarz danschwarz left a comment

Choose a reason for hiding this comment

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

Works well with iTerm now, thanks @AnonymouX47

@danschwarz danschwarz merged commit c622cbb into ihabunek:master Jun 5, 2024
5 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.

2 participants