Blinking cursor disappears after switching windows #686

Closed
opened 2 months ago by kahatlen · 6 comments

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
  1. Start foot with no configuration.

  2. Run tput cvvis to make the cursor start blinking.

  3. 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.

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 ``` 1. Start foot with no configuration. 2. Run `tput cvvis` to make the cursor start blinking. 3. 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.
Poster

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

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.)
Owner

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 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!
dnkl closed this issue 2 months ago
Owner

Should be fixed in the master branch now!

Should be fixed in the master branch now!
Poster

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 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.
Owner

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.

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.
Poster

Right, I wasn't really sure exactly what to expect from that option, and I didn't care much about a blinking cursor, so I didn't report it. But when your fix made the cursor start blinking when the option was set, it was pretty obvious that the old behaviour was unintended. :)

Right, I wasn't really sure exactly what to expect from that option, and I didn't care much about a blinking cursor, so I didn't report it. But when your fix made the cursor start blinking when the option was set, it was pretty obvious that the old behaviour was unintended. :)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.