-
Notifications
You must be signed in to change notification settings - Fork 7
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
Windows: prompt is flickering #84
Comments
I used the latest main for a while, and this is very annoying, that I will have to revert to an older version that didn't do that. Update: Older version does it too. Maybe this bug was there from the beginning, I just didn't notice until now. The flicker does not happen on Linux. So it's a Window specific issue. |
Can you try nushell and see if you experience the same? I and many others had similar problems on Windows. Undortunately nobody seems to have an idea where it comes from, but it’s especially bad on Windows Terminal |
I just tested nushell installed using conda and it flickers as well. Generally such flicker in any terminal comes from erasing the line and redrawing, as well as possibly from not turning off the cursor when redrawing. Our C++ terminal multi-line prompt does not flicker: https://github.com/lfortran/lfortran/tree/79e7444ca0e58adbaa06db5e839b91d5e9eb915f/src/bin/tpl/cpp-terminal, so we can use it. However the system behind it is really simple, so we just need to write our own Rust version of it, or fix the upstream codes. This is terminal 101. :) Such basic issues must be resolved from the beginning. :) |
Seems like something has been fixed recently: microsoft/terminal#16769 Maybe we don't have to do anything to fix it :) |
That particular fix was done in March, which means I am already running it. The fact that my prompt works shows that it is possible to make it work well in Windows Terminal. I'll try to write a demo using Rust that works. A simple fix is to not update the whole line, but only what changed. But even updating a line that didn't change should not flicker generally. However if you first put spaces (to clear old contents) and then redraw, it will flicker in some terminals. My point is that we should not depend on a particular implementation of a terminal. We have to write the shell in such a way to work in all terminals and not flicker. Since I have code that works, it's simply our own bug that we should fix. In addition, there might be some bug in the Terminal that would allow even imperfect code to not flicker, but we don't want to depend on it. |
On another machine, the following Windows Terminal version does NOT flicker: Windows Terminal The first machine where it flickers is: Windows Terminal So the same version. |
This is hard to show in a screenshot, but especially when hitting TAB, the prompt is flickering. It didn't used to do that. It also happens when hitting Backspace.
When redrawing it, one must not erase the old stuff, just write new stuff over it.
A separate issue is that when hitting enter, the cursor goes to the left quickly, which again must be fixed, for example by turning the cursor off, drawing, turning it on.
This is a big usability bug. :)
The text was updated successfully, but these errors were encountered: