Blinking cursor disappears after switching windows
I've noticed that the cursor is sometimes not visible when I switch back to a foot window where Emacs is running. Usually, the cursor becomes visible again when I move it with the arrow keys. But not always. Sometimes I can get it back again by moving the cursor all the way to the beginning/end of the buffer, to make Emacs ring the bell. But not always. (The cases where the cursor won't reappear after cursor movement are typically in tmux on a remote server running a somewhat old version of Emacs (26.1).)
I can reproduce it without Emacs/ssh/tmux like this under GNOME 3.38.4 on Debian 11, and this version of foot (latest from git):
% foot --version foot version: 1.8.2-106-g9d1de747 (Aug 17 2021, branch 'master') -pgo +ime -graphemes
Start foot with no configuration.
tput cvvisto make the cursor start blinking.
Switch to another window with Alt-TAB, and then switch back to foot again with Alt-TAB.
Now the cursor is not blinking any more. If you hit Alt-TAB at a moment when the blinking cursor was invisble, the cursor will stay invisible until you run
tput cvvis again. If the blinking cursor was visible when you hit Alt-TAB to switch away from foot, it will still be visible when you switch back to foot, but it will not be blinking any more. It's as if the blinking cursor froze in the state it had when the foot window lost focus.
The obvious workaround for the disappearing cursor in Emacs with foot, is to disable the blinking cursor in the Emacs config, and use a plain non-blinking one:
(setq visible-cursor nil)
(I might keep this, even after the problem is fixed in foot.)
Thanks for a great bug report.
I don't use a blinking cursor myself, neither do I use GNOME, which is why this pretty obvious bug has gone unnoticed for so long (it doesn't happen on Sway)...
Anyway, fix was easy; PR coming later today!
Thanks for the quick fix! It seems to be working fine now. Additionally, this fixed the cursor.blink option. Before the fix, with GNOME, setting the blink option to yes in foot.ini didn't have any effect. Didn't even have to switch focus to make it stop blinking. But at least it was stuck in the visible state and not in the invisble one. Now the cursor blinks as expected when the option is enabled.
Thanks for the update! I wasn't aware of the issue with
cursor.blink under GNOME. I've updated the CHANGELOG to mention that this (too) has been fixed.
Deleting a branch is permanent. It CANNOT be undone. Continue?