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

what to do when a view gets longer than the screen as it flickers badly on updates #359

Open
KyleAMathews opened this issue Aug 8, 2020 · 11 comments
Labels

Comments

@KyleAMathews
Copy link

ink-flickering

Is there any easy way to detect when this is happening so we can take corrective measures?

@vadimdemedes
Copy link
Owner

Hm, not really, this is up to your terminal to render the text, so the flickering is on them. For example, while iTerm may flicker, built-in terminal app in macOS almost never does.

As for the code here, what is the UI supposed to do? I will probably be able to help better if I'm more familiar with your use case.

@H3RSKO
Copy link
Contributor

H3RSKO commented Sep 4, 2020

We noticed in our app (gitgud) that iTerm2 would cause it to become almost unusable due to flickering. If you switch terminals to hyper or the default mac terminal it will almost completely fix the issue. I think it is just an iTerm2 bug.

@mAAdhaTTah
Copy link
Contributor

FWIW, I feel like lately iTerm2 has been having issues like this that are definitely unrelated to Ink. Just streaming significant of output in general has been weird. Maybe the most recent update had a bug or something?

@marcus13371337
Copy link

marcus13371337 commented Jan 25, 2021

Hello,

I'm having issues running my application in "fullscreen" on iTerm. The screen is flickering really badly when there are a lot of updates to the screen. It seems as iTerm queues up all the frames and shows them one by one instead of just showing the latest frame.

My application is a circle-ci dashboard. I was inspired by k9s (https://github.com/derailed/k9s) which runs really smoothly on iTerm (written in go though). Have a look at my project to see if you can find any gotchas:
https://github.com/marcus13371337/circle-dash

@H3RSKO
Copy link
Contributor

H3RSKO commented Jan 25, 2021

It seems to be an iTerm issue. Try using a different terminal.

@marcus13371337
Copy link

marcus13371337 commented Jan 25, 2021

Yes, it's definitely an iTerm issue, however, if I were to distribute my cli I want it to run smoothly in every terminal. Since there are applications running smoothly on iTerm (k9s as an example), I guess there are some hacks/features ink can implement in order to make the iTerm experience better

@marcus13371337
Copy link

Think I found a solution to the problem which I've presented in the following PR:
#413

@H3RSKO Would you be super kind to try it with gitgud in iTerm and confirm that it fixes the flickering, would be super nice. It's not 100% bug-free though

@pie6k
Copy link

pie6k commented Feb 28, 2021

CleanShot 2021-02-28 at 12 47 01

For me this happens in mac default terminal as well (using oh-my-zsh) as soon as I set main container Box height to process.stdout.rows and update any part of the content (happens in iTerm as well)

@royshouvik
Copy link

royshouvik commented Jul 24, 2021

The changes in the linked PR drastically improves the flickering in iTerm for me. Although I needed to make the box height 1 less than process.stdout.rows.

@p00dle
Copy link

p00dle commented Oct 29, 2023

Just chiming in to say that I had the same problem on Windows, and @royshouvik 's solution worked for me as well for Windows Terminal both cmd and PowerShell. Thank you for the tip!

@lucsoft
Copy link

lucsoft commented Jul 8, 2024

Is there plans to still merge the POC or something more polished (if needed)?

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

No branches or pull requests

9 participants