-
Notifications
You must be signed in to change notification settings - Fork 234
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
Long pause/halt when lipgloss is determining background color #73
Comments
Hey @jefferai, long time no see! termenv is querying the terminal for its current settings via control sequences on stdout, and the terminal is expected to respond by printing to stdout, which termenv reads from. There's a timeout of 5 seconds defined, after which the It looks like Could you verify whether bytes are actually slowly trickling in or if it's stuck there waiting for a response that'll never arrive? |
Hi @muesli 😀 It's definitely not 5 seconds. Sometimes it's 2 or 3; often it's 10 or so; sometimes (very rarely) it's 30 or more. I don't think I've seen it completely freeze forever. How would you want me to verify that bytes are trickling in? Just fork the lib and print debug out? I can also see if it happens in other envs. I'm running on arm64 M1 on Monterey 12.2.1 in iTerm using zsh. I did try with bash without any difference. Stock terminal makes no difference. |
Same exact issue here, this issue appeared when I tried the component |
After more investigating, the real cause for me was from |
@R4ndomX That observation is correct, yeah. I think I finally figured out under which circumstances this is happening: if the first background detection happens only after bubbletea has taken over control of stdin/out, the communication channel between terminal and termenv is essentially broken. You could work around this issue by manually calling We'll clean this up and may have to refactor the API a bit here. See upcoming work in |
It turns out that there is a lipgloss/termenv/bubbletea/reality incompatibility when querying the background color. By querying this once at the start before bubbletea takes control of the terminal, this can be avoided. See charmbracelet/lipgloss#73 (comment) for details.
Is there any update on having this issue fixed within My understanding is that the issue arises because Calling In the meantime, I think it would be helpful to update the README to mention this issue under the Thank you! |
@mikecbone Noted! For what it's worth we have some upcoming features that both run background color detection in a non-blocking way and let you opt out of it entirely. |
I am still having this issue as of version |
@ElectricPulse How about with If you're still having that issue as of that version, can you post some source code we can use to reproduce the issue? |
Sometimes when running my program (very similar to the fancy list demo and using the same lipgloss variables), when my list is created, I see a very long pause. It doesn't happen all the time -- over half the time, but not every time -- but that pause can take anywhere from a few seconds to 30 seconds or more. I got a
SIGQUIT
stack trace -- it's down intermenv
so let me know if you'd rather I post there than here, but since my entrypoint there islipgloss
I figured I'd start here.Let me know what other info I can provide. Thanks!
The text was updated successfully, but these errors were encountered: