-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
The cursor jumps to the end of the line and immediately returns to the correct position when typing in a Git Bash profile #6217
Comments
When I run bash under "script" (which captures its output), it looks like this is exactly what the shell is emitting.
If I type
which advances the cursor two cells and then puts the cursor back before the Make no mistake -- this is how all terminal emulators are handling it. It just so happens that our cursor updates are visible through the If somebody wants to look at this, they may consider moving the |
Note: I tried fixing this in conjunction with #1087 this morning. Just moving the |
This seems to be fixed in recent versions, at least I am not seeing it any more. |
Can we reopen this? I'm still seeing this on the most recent build of Windows Terminal Preview. I'm wondering if this is the same root cause for another problem I have. If I'm doing nothing at my zsh prompt (or inside neovim), the cursor will flicker occasionally instead of staying solid. Is it because Terminal is processing cursor updates faster than zsh/neovim can redraw? |
Sure, I'll reopen it. I haven't seen this happening any more since I closed the issue though, so it seems as if it depends on your local setup. |
Good thing it was reopened yesterday. I just set up git bash on terminal and I'm getting this issue as well. |
I'm getting the same issue in my git bash when running it on windows terminal |
I'm getting the issue only when i have zsh-syntax-highlighting plugin enabled in git bash. It might have to do with changing color of the text while typing? This also only happens in the windows terminal. Inside intelliJ or vscode virtual console seems to not jump or flicker |
I wanted to provide some further information I just found when testing to narrow down which ZSH plugins cause the flickering issue. Testing Setup
To ensure a clean environment, I removed all plugins from my ZSH config, ensuring the environment was clean before testing each plug-in individually. ResultsThe flickering issue can be reproduced when the I will also note that the issue appears to have been fixed (or at least it is not noticeable) in Terminal version 1.18.10301.0. I have tested later versions and they all have the flickering issue present. |
I suspect what caused this in newer versions is that we do not delay rendering anymore when we receive input. So, if an application sends "some" followed by "text", we may now render "some" and then "some text" in the next frame. The ideal solution is for applications to be mindful over when to emit text to What I think we could do is a technique called "late latching", commonly used in VR rendering and perhaps newer FPS to reduce input latency by delaying rendering until shortly before the next v-blank. But I believe even that only reduces the rate of flickering, and does not fix it. |
Environment
Steps to reproduce
Open a Git Bash tab. My profile looks like this:
Type something like
git commit -m ""
and press left arrow to put your cursor into the quote marks.Then type a commit message.
Expected behavior
After you type a character the cursor should be drawn directly after that character.
Actual behavior
The cursor jumps to the end of the line before returning to the correct position. Here is a gif of it happening:
The jumping happens with every typed character, but because of framerate reasons the gif only captured a jump after the second
r
in "cursor" and them
in "jumps".The text was updated successfully, but these errors were encountered: