jesseduffield / lazygit

simple terminal UI for git commands
MIT License
51.68k stars 1.81k forks source link

Blinking prompt cursor after committing with lazygit and urxvt & VSCode term on Windows #2948

Open ygaeon opened 1 year ago

ygaeon commented 1 year ago

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

  1. mkdir test && cd test
  2. git init
  3. echo "Hello" > world
  4. lazygit
  5. Commit the changes with a message (I think any message will do, but here I used "test")
  6. Quit lazygit

Now, my prompt cursor is blinking.

Expected behavior Cursor should be in the same state as when lazygit was started.

Version info:

$ lazygit --version
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64, git version=2.41.0
$ equery l lazygit
 * Searching for lazygit ...
[I-O] [  ] dev-vcs/lazygit-0.40.0:0

Additional context

mark2185 commented 1 year ago

Could you try other terminal emulators? E.g. kitty, terminator etc.?

ygaeon commented 1 year ago

Kitty 0.29.2 cursor_blink_interval 0 -> ~/.config/kitty/kitty.conf Ran my test -- no blinking cursor

Alacritty 0.12.1 Ran my test -- no blinking cursor

WezTerm 20230408-112425 Ran my test -- no blinking cursor

Conclusion: urxvt does things differently :-) (updated the original report)

bartoszluka commented 1 year ago

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

ygaeon commented 1 year ago

Thank you @bartoszluka, for finding other sources of this issue. I really like my urxvt and would want to see this fixed in lazygit for sure.

unikitty37 commented 2 months ago

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…)

ygaeon commented 2 months ago

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.

unikitty37 commented 2 months ago

Interestingly, lazygit resets the cursor when I quit — it just blinks while I'm using lazygit in VSCode…