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

Implement synchronized output for urwid images #80

Merged
merged 10 commits into from
Mar 6, 2023

Conversation

AnonymouX47
Copy link
Owner

@AnonymouX47 AnonymouX47 commented Mar 4, 2023

Partially implements #79
See also: #73

  • Moves automatic image clearing into UrwidImageScreen.draw_screen().
  • Removes UrwidImageJanitor in favour of UrwidImageScreen.
  • Adds support for synchronized output to UrwidImageScreen.
    • Reduces/Eliminates image flickering/tearing on supporting terminal emulators.

- Add: Incorporate automatic image clearing into
  `UrwidImageScreen.draw_screen()`.

Seems to be a more appropriate place for the functionality.
- Add: Implement support for terminal synchronized output in
  `UrwidImageScreen`.

Reduces/Eliminates image flickering/tearing.
@AnonymouX47 AnonymouX47 added new New feature implementation urwid Related to the urwid image widgets/canvas labels Mar 4, 2023
@AnonymouX47 AnonymouX47 added this to the 0.6.0 milestone Mar 4, 2023
- Change: Retire `UrwidImageJanitor` in favour of `UrwidImageScreen`.
- Change: Migrate tests for `UrwidImageJanitor` to `UrwidImageScreen`.
- Change: Improve shard canvas inspection by first checking if it's an
  `UrwidImageCanvas` before performing any other check or operation on
  it.
- Change: If images to be cleared include an iterm2-style image, then
  just clear all at once and skip per-widget clear for any kitty images.
@AnonymouX47
Copy link
Owner Author

AnonymouX47 commented Mar 5, 2023

@danschwarz Please, can you help test it out? 🙏🏾

@danschwarz
Copy link

Removed UrwidImageJanitor and the toot image11 branch works fine with the new code.
Testing so far:

  1. Windows Terminal - no image support, uses ANSI graphics, works fine no problems.
  2. Kitty - flicker free scrolling with the largest image sizes I've tested
  3. Wezterm - flicker free scrolling
  4. Kitty over a slower ssh link to a remote server - still no flicker

👍

@AnonymouX47
Copy link
Owner Author

That's great!

@AnonymouX47 AnonymouX47 merged commit 9cebc2d into main Mar 6, 2023
@AnonymouX47 AnonymouX47 deleted the synced-output-urwid branch March 6, 2023 02:27
AnonymouX47 added a commit that referenced this pull request Mar 26, 2023
- Add: Synchronize the following I/O methods of `UrwidImageScreen`
  with `.utils.lock_tty()`:

  - `get_available_raw_input()`
  - `flush()`
  - `write()`

Refs: #73, #80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New feature implementation urwid Related to the urwid image widgets/canvas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants