Vim did not used to do Step 4 and 5 of 'Steps to reproduce' and I only started to have this problem recently when I updated ncurses from ncurses-6.4-2 to ncurses 6.4_20230520-1.
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 20 2023 16:56:14) Included patches: 1-1572 Compiled by Arch Linux
OS: Arch Linux x86_64
Kernel: 6.3.6-arch1-1
Shell: bash 5.1.16
Terminal: alacritty 0.12.1
$TERM: alacritty
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Most of the things you said went over my head. I am not that familiar with vim jargons.
If it was not clear from the initial comment, this issue started happening when I updated ncurses from ncurses-6.4-2 to ncurses 6.4_20230520-1 and downgrading ncurses fixes this issue. I made a post in r/vim and other people are facing the same problem and all of us started facing this problem when updating from ncurses-6.4-2 to ncurses 6.4_20230520-1 and most of us use alacritty. So, maybe I should have started from making a bug report in alacritty before here since alacritty has ncursers as dependency and it seems to be the main cause of this. And I agree on your stance to not write terminal specific code and following a standard.
Anyways, t_fe and t_fd are empty on both versions of ncursers. I also followed the documentation on xterm-focus-event but it did not help.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I'm not sure if it would be OK to recognize CSI I and CSI O for all terminals.
@brammool Alacritty wouldn't be sending those sequences for a focus change unless you specifically requested that behavior by setting mode ?1004. So if you don't want to recognise CSI I and CSI O for all terminals, then just don't set mode ?1004 for all terminals.
As for how you determine whether it's safe to set mode ?1004, the standard way to do that on DEC-based terminals would be a DECRQM request. Not everyone supports that (I don't think Alacritty does), but quite a lot do, and if you consider this a non-essential feature, it's not unreasonable to have it off by default, and then enable it only when you can positively confirm support with DECRQM.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I have no idea what effect changing the ncurses version has.
A recent ncurses commit added mode ?1004 to the XM terminfo entry for xterm+sm+1006, so I'm assuming that would affect anyone with a TERM value derived from that.
I don't see how this helps. Especially if we don't know whether it
works. We could just set t_fe and t_fd to the values used for xterm.
Either they work or they should be ignored.
It's not about the mode being ignored - it's the fact they you're choosing not to process the CSI I and CSI O reports after setting the mode. So either you always accept those reports, or you selectively enable the mode on terminals that you believe it's safe to do so. I'm suggesting DECRQM is one way to determine that. Or you could just rely on the terminfo, but that appears be what triggered this issue in the first place.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #12499 as completed via 85ef2df.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Note that XTerm defines mode ?1004 as "Send FocusIn/FocusOut events". And if you follow the FocusIn/FocusOut link, you'll see "it causes xterm to send CSI I when the terminal gains focus, and CSI O when it loses focus."
So those codes are literally part of the definition for mode ?1004 - terminals don't have any other option if they're claiming to support that mode.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()