GNOME Bugzilla – Bug 762963
Cursor waits before changing shape in neovim
Last modified: 2016-03-17 10:12:14 UTC
I have let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 in my neovim config. It makes the cursor changing from block to caret mode on insertion. In termite/gnometerminal/vtetest, I have to hit at least one key for the cursor to update its shape. I've tested in urxvt and upon entering insert mode, the cursor changes shape immediately hence I think it's a vte problem. This seems similar to https://bugzilla.gnome.org/show_bug.cgi?id=753645 which should have been fixed in 0.4X but I use https://github.com/thestinger/vte-ng which should have the fix but still have the problem apparently ?
I've never heard of vte-ng. Could you please test with latest mainstream vte (stable/unstable tarball or git, whichever of these)?
I assume that something along the lines of echo -ne '\e[2 q'; sleep 2; echo -ne '\e[6 q'; sleep 100 would reproduce the problem, but for me it doesn't. (Tested with 0-42 and master.) What cursor shape do you switch to/from? Is it buggy in both directions? Do the cursors blink?
Haha, interestingly, using neovim, I _can_ reproduce the problem just like you described it.
neovim definitely prints the relevant escape sequence. A focus out/in repairs vte's look. Definitely a bug in vte.
Looks like the bug is related to the cursor moving away, changing shape there, and moving back again to its previous location – all these within a single update cycle. An easy way to reproduce: echo -ne '\e[2 q'; sleep 2; echo -ne '\e[C\e[6 q\e[D'; sleep 100
Created attachment 322845 [details] [review] Fix for vte-0-42
Created attachment 322846 [details] [review] Fix for master
Fixed on master, 0-44 and 0-42. Christian, how about a 0.42.5 tarball? Shall we try to squeeze this fix into Ubuntu Xenial LTS? I'd love to since it's an important usability fix, and neovim is likely to get quite popular.
Wow that was fast :) Thanks for the fix. vte-ng from what I gathered is just vte + a small patch refused upstream and is only used by termite. I do believe neovim gets traction so fixing in the LTS could prevent a few bug reports.
Neovim issue for maybe a workaround: https://bugzilla.gnome.org/show_bug.cgi?id=762963
Meh, wrong copy-paste. Neovim issue for maybe a workaround: https://github.com/neovim/neovim/issues/4395
(In reply to Egmont Koblinger from comment #8) > how about a 0.42.5 tarball Let's wait a bit if more fixes turn up? Maybe along with 3.20.0 ? > ? Shall we try to squeeze this fix into > Ubuntu Xenial LTS? I'd love to since it's an important usability fix, and > neovim is likely to get quite popular. When would be the latest date for a tarball to make that possible?
Just FYI: The fix (0.42.5) made it into Xenial LTS, hooray!