-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Blinking prompt cursor after committing with lazygit and urxvt & VSCode term on Windows #2948
Comments
Could you try other terminal emulators? E.g. |
Kitty 0.29.2 Alacritty 0.12.1 WezTerm 20230408-112425 Conclusion: |
Also happens on Windows in VSCode terminal. When exiting it changes the configured cursor to (probably a default) blinking block, while my configured style is nonblinking vertical line. I checked that the last version that didn't change the cursor style upon exiting is 0.29, so maybe that helps |
Thank you @bartoszluka, for finding other sources of this issue. I really like my |
Same here on macOS in VSCode terminal. I don't even have to exit — as soon as lazygit prompts me for input (such as a commit message), the cursor is blinking. Blinking cursors are a severe distraction for some people, so if lazygit must override the cursor, could it at least set it to a non-blinking block? As it is, I have to juggle positioning VSCode and a separate terminal rather than simply use the built-in VSCode terminal. (Also, as a note, this doesn't occur in iTerm 2, either…) |
I've noticed that if I have a blinking cursor, after using lazygit, and I just start nvim/neovim and quit, the cursor is reset to what I want. |
Interestingly, lazygit resets the cursor when I quit — it just blinks while I'm using lazygit in VSCode… |
I confirm this issue. Seems lazygit changes cursor style for commit message dialog using XTerm control sequences (DECSCUSR). Is there any way to not change cursor style in commit dialog? XTerm specification seems has no easy way to restore cursor style (discussion), so better to not change it. |
I can confirm this with VS Code's terminal on Windows (but not on Mac). Lazygit does restore the cursor back to the default when it quits, but this whole business of ANSI escape sequences and termcap/terminfo stuff is so much of a science that I'm honestly not sure if this is a bug in VS Code's terminal. Based on a few experiments I made, I'm inclined to say that it is. For example, if you type Not sure what to do about this; it takes someone with more expertise in this area than me. But in the meantime, you should be able to workaround it by doing something like |
Thanks for that workaround @stefanhaller .. can confirm it works. |
@stefanhaller It works, but a bit ugly. Better to not touch cursor style at all, it is not required for lazygit functionality. For example, I use SecureCRT terminal, cursor style: wide vertical bar without blinking. But in lazygit commit text cursor style changes to blinking block for some reason. In the same time, Midnight Commander has a lot of dialog boxes and never changes cursor style. Also, I can't restore my default cursor style "wide vertical bar", only change narrow vertical bar, seems width is missing in xterm :( |
The workaround isn't useful for me, as the cursor still blinks while in lazygit. My requirements are for the cursor to not blink at any time, which is in accordance with my settings — as I said, this is an accessibility issue. The fix is for lazygit to not mess with the cursor, or to provide a setting which disables all such messing. |
Ok, makes sense to me. I'd be open to changing this. (Of course it's not me who makes decisions here, it's @jesseduffield.) Trouble is, I couldn't find any code in lazygit that does this, nor in gocui which is the TUI library that lazygit is built on. My suspicion is that this needs to be changed in tcell, but I couldn't find the code that's responsible for changing the cursor there, either. If anybody who is more knowledgeable with this stuff than me can point me to the code that is responsible for this, I'm happy to work on a PR. |
Describe the bug
When using lazygit, with
rxvt-unicode
, and exits, sometimes the cursor is blinking whilst I normally have a non-blinking cursor in the shell.To Reproduce
I believe the following should trigger the behavior:
Start: my prompt cursor is not blinking
mkdir test && cd test
git init
echo "Hello" > world
lazygit
Now, my prompt cursor is blinking.
Expected behavior
Cursor should be in the same state as when lazygit was started.
Version info:
Additional context
The text was updated successfully, but these errors were encountered: