GNOME Bugzilla – Bug 753645
Terminals don't always react to cursor changing control sequences
Last modified: 2015-09-13 13:46:57 UTC
Testing neovim [1], I found the cursor doesn't always react on control sequences that change the cursor (if you've used vim, you'll know it has modes; neovim can change the cursor shape when switching modes using control sequences). I opened a pull request to try and refresh neovim's terminal ui forcefully on cursor changes [2], but when trying to do it less bluntly (by redrawing the cell under the cursor instead of the whole screen), I found it didn't work in some cases under gnome-terminal. I'm assuming this issue lies at the vte library level, although I might be wrong. We found that this issue wasn't necessarily caused by neovim's handling of control sequences or the terminal libraries it uses, since we could reproduce using this python script: ~~~ #!/usr/bin/env python import sys import time time.sleep(2) sys.stdout.write('\x1b[5 q') sys.stdout.flush() time.sleep(2) sys.stdout.write('\x1b[2 q') sys.stdout.flush() time.sleep(2) ~~~ where the cursor gets changed to the bar (|) first and then gets hidden (while it should be restored as a block). I'm opening this ticket mostly to see if someone can confirm this and has some idea of what's going on. [1]: https://github.com/neovim/neovim/ [2]: https://github.com/neovim/neovim/pull/3110
Created attachment 309325 [details] [review] Fix Note: for the example to work, you should start with a steady cursor. The actual problem is that the blink cycle is stuck in its "off" state. Fix attached.
Thanks a lot for taking a look, Egmont. I'll update the neovim PR accordingly and just wait for this fix to land.
Fixed
Older VTEs are affected too. They don't support these escape sequences yet, but you can still trigger the bug with sleep 2; dconf write /org/gnome/desktop/interface/cursor-blink false