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

feat: Synchronized output #1027

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nervo
Copy link

@nervo nervo commented May 29, 2024

This is an attempt to implement synchronized output in bubbletea. At this time, this is so naive, that you can see it as a proof-of-concept :)

Anyway, this does not break on my machine 👍

Some interesting reading:

Feel free to comment ❤️

@aymanbagabas aymanbagabas marked this pull request as draft May 30, 2024 15:17
@aymanbagabas aymanbagabas marked this pull request as draft May 30, 2024 15:17
@vito
Copy link

vito commented Jun 13, 2024

Friendly poke to whoever can keep this moving, could really use this for my TUI as it flickers pretty heavily on certain terminals. Cool to see a PR up for it already! 😄

@nervo
Copy link
Author

nervo commented Jun 13, 2024

@vito do you think you can give a try ?

Dear maintainners, are you ok with the way the feature is implemented (wording of methods and variables) ?

For the feature itself, i'm not an ansi guru, i just need to know:

  1. if i made the terminal query the good way
  2. If i understood the protocol correctly (the event.Value 2 or 4)
  3. if i'm doing the right things: sending the enable code just before, and the disable code right after writing the buffer, both independently from the buffer itself.

Copy link

@vito vito left a comment

Choose a reason for hiding this comment

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

Tried it out and went looking for how to enable it, and noticed it just enables itself if the terminal supports it, which makes sense to me. 👍

I think I found a typo along the way though - left a suggestion.

standard_renderer.go Outdated Show resolved Hide resolved
@meowgorithm
Copy link
Member

Hey @nervo! Thanks for looking into this one, it's something we've very much been wanting to get in.

API aside, the big thing that will need to happen for this feature to work is an implementation at the renderer level so that Bubble Tea can repaint in-step with the terminal. We're currently working on an overhaul to the renderer, so we should hold off on this until we've made that update.

@nervo
Copy link
Author

nervo commented Jun 24, 2024

@meowgorithm ok, good to hear 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants