After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762963 - Cursor waits before changing shape in neovim
Cursor waits before changing shape in neovim
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-02 02:24 UTC by mattator@gmail.com
Modified: 2016-03-17 10:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for vte-0-42 (1.24 KB, patch)
2016-03-02 11:33 UTC, Egmont Koblinger
none Details | Review
Fix for master (1.22 KB, patch)
2016-03-02 11:39 UTC, Egmont Koblinger
none Details | Review

Description mattator@gmail.com 2016-03-02 02:24:12 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 ?
Comment 1 Egmont Koblinger 2016-03-02 09:34:46 UTC
I've never heard of vte-ng. Could you please test with latest mainstream vte (stable/unstable tarball or git, whichever of these)?
Comment 2 Egmont Koblinger 2016-03-02 10:03:42 UTC
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?
Comment 3 Egmont Koblinger 2016-03-02 10:22:09 UTC
Haha, interestingly, using neovim, I _can_ reproduce the problem just like you described it.
Comment 4 Egmont Koblinger 2016-03-02 10:26:38 UTC
neovim definitely prints the relevant escape sequence. A focus out/in repairs vte's look. Definitely a bug in vte.
Comment 5 Egmont Koblinger 2016-03-02 10:29:58 UTC
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
Comment 6 Egmont Koblinger 2016-03-02 11:33:32 UTC
Created attachment 322845 [details] [review]
Fix for vte-0-42
Comment 7 Egmont Koblinger 2016-03-02 11:39:17 UTC
Created attachment 322846 [details] [review]
Fix for master
Comment 8 Egmont Koblinger 2016-03-02 11:52:52 UTC
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.
Comment 9 mattator@gmail.com 2016-03-02 12:40:30 UTC
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.
Comment 10 Egmont Koblinger 2016-03-02 18:24:17 UTC
Neovim issue for maybe a workaround: https://bugzilla.gnome.org/show_bug.cgi?id=762963
Comment 11 Egmont Koblinger 2016-03-02 18:24:46 UTC
Meh, wrong copy-paste.

Neovim issue for maybe a workaround: https://github.com/neovim/neovim/issues/4395
Comment 12 Christian Persch 2016-03-02 21:32:11 UTC
(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?
Comment 13 Egmont Koblinger 2016-03-17 10:12:14 UTC
Just FYI: The fix (0.42.5) made it into Xenial LTS, hooray!