Bug 2251437 - [regression] stray input bytes when enabling mouse events (since ncurses-6.4-7.20230520) causing issues in tin when running in vte-based terminals
Summary: [regression] stray input bytes when enabling mouse events (since ncurses-6.4-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ncurses
Version: 38
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-25 00:43 UTC by ksi@koi8.net
Modified: 2024-03-14 01:38 UTC (History)
7 users (show)

Fixed In Version: ncurses-6.4-7.20230520.fc39.1 ncurses-6.4-7.20230520.fc38.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-03-01 01:08:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME vte issues 2739 0 None opened Right arrow, 'L' and 'q' keys not working correctly in TIN when running in gnome-terminal and mate-terminal (work fine i... 2024-02-15 11:23:34 UTC

Description ksi@koi8.net 2023-11-25 00:43:47 UTC
Totally broken in Mate/Gnome terminal. When started, immediately asks if I want to abort the operation. Without any response to this continues operation when focus switched from that terminal window. Left arrow key not operational -- either doesn't react to it at all or shows "Save configuration before continuing?" and doesn't exit newsgroup or rtin when initial list of groups is shown. Returns to where it was when focus switched from the terminal window it runs in. Impossible to exit other than killing the process or by 'Q' (capital) command that doesn't save state and sometimes kills the subscribed groups, even unsubscribing them on the server.

Also displays "Bad command. Type 'h' for help." when focus switched on and off the terminal window.

Almost works in "konsole" terminal -- everything works as expected, left arrow works, almost OK but also show that "Do you want to abort current operation?" when focus is switched off that konsole window. However, in konsole it is just an annoyance -- that message disappears when focus is switched back to that window and everything continues to work as expected. In Gnome (gnome-terminal) or Mate (mate-terminal) it is totally unusable.

Worked OK in Gnome/Mate in Fedora 27 to 38 (maybe even earlier, don't remember) although showing that "Bad command" on focus changes. That was not even an annoyance -- I simply used to ignore that message. It was there for as long I started using Gnome even before Mate fork.

Reproducible: Always

Steps to Reproduce:
1. Open Gnome/Mate terminal
2. Type e.g. "rtin -g some_nntp_server".
3. Get that "Do you want to abort" message right away.




Happens in Mate and Gnome desktop. Machines are fully loaded Dell T5500 -- Dual Xeon X5675  @ 3.07GHz (12 physical cores total), 72 GiB of RAM.

Comment 1 Dominik 'Rathann' Mierzejewski 2023-11-28 18:26:46 UTC
Thanks for the report. I'm able to reproduce the issue.

Comment 2 Dominik 'Rathann' Mierzejewski 2023-12-19 10:25:55 UTC
Ok, so with the latest updates (as of today), it's a bit better. Not unusable any more, but still annoying.

It's as if the arrow keys and 'q' key send some extra codes not recognized by tin or its keyboard input library.

The issues I can reproduce are:
1. "Bad command. Type 'h' for help." is displayed almost all the time.
2. Using the left or right arrow key to enter/leave groups brings up "Do you want to abort this operation? (y/N)" message, but only if you pressed some other key earlier. Entering/leaving the same group works.
3. Trying to quit using 'q' key doesn't work. Repeated pressing of 'q' brings up "Save configuration before continuing? (Y/n)" message.

I'll take a closer look as soon as I have more time.
Ideas:
1. One of the updated dependencies is breaking keyboard input.
2. Miscompilation (compare configure.log from F38 and F39).

F38 build: https://koji.fedoraproject.org/koji/buildinfo?buildID=2133945
F39 build: https://koji.fedoraproject.org/koji/buildinfo?buildID=2257456

Comment 3 Dominik 'Rathann' Mierzejewski 2024-01-24 14:10:16 UTC
I found some issues related to custom autoconf macros. Scratch build to test here: https://koji.fedoraproject.org/koji/taskinfo?taskID=112173847 , please test.

Comment 4 Dominik 'Rathann' Mierzejewski 2024-01-24 20:22:12 UTC
Never mind, I was able to test that build and it's not fixing the bug.

Comment 5 Dominik 'Rathann' Mierzejewski 2024-02-02 11:16:26 UTC
I've reported this upstream and we're trying to figure it out together. Upstream asked for `stty -a` output from different terminal emulators. Please provide yours, if they're different.

Comment 6 ksi@koi8.net 2024-02-02 19:05:29 UTC
Here it is:

Gnome (Mate) terminal:

[ksi@maverick ~]$ stty -a
speed 38400 baud; rows 30; columns 100; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany
-imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho
-extproc


Konsole terminal:

[ksi@maverick ~]$ stty -a
speed 38400 baud; rows 30; columns 100; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff -iuclc -ixany -imaxbel
iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho
-extproc

Comment 7 Dominik 'Rathann' Mierzejewski 2024-02-05 09:21:08 UTC
Thanks. It looks like the only difference is ixoff, but flipping the setting doesn't change behaviour in gnome-terminal.

Since tin works correctly in xterm, I agree with upstream that this is not a bug in tin.

Reassigning to vte291 for now as this is a common dependency of gnome-terminal and mate-terminal.

Comment 8 Dominik 'Rathann' Mierzejewski 2024-02-05 09:24:48 UTC
For those without access to a Usenet server, here's the public tin one to test and reproduce the issue:
$ NNTPSERVER=news.tin.org rtin

Comment 9 Dominik 'Rathann' Mierzejewski 2024-02-06 12:54:14 UTC
Bad news, I'm able to reproduce this on F38 as well. While the 'q' key is working correctly, 'L' (capital ell) is not. In xterm, it invokes the "Enter Message-ID to go to:" correctly, but under gnome-terminal it only shows "Bad command. Type 'h' to help.".

And I started getting the "Do you want to abort this operation? (y/N) N" prompt when entering a newsgroup using right arrow key, too.

I'll try to identify which package update caused this.

Comment 10 ksi@koi8.net 2024-02-16 01:12:44 UTC
OK, it _IS_ a bug in tin. There might be some changes in GNOME and wherever else but it is ONLY tin that was affected. Absolutely everything else wors as it used to work before. Just look at e.g. alpine -- no problems whatsoever, everything works including right/left arrow functionality to enter/exit message/folder/attachments and whatever else.

Everything else also works as it used to -- mc, joe, various text mode utilities, ALL of them. It is ONLY tin that is affected so it is 100% tin's problem. It MIGHT be that some changes affected tin but that ONLY means it was buggy from the very beginning, just that bug was not triggered before.

I don't think it is a very good idea to put blame elsewhere for something that made ONLY ONE program to misbehave. And I think it would be justifiable if those guys who are being blamed just reply with "Scrap tin, junk it". It is definitely something with signal handling or termcap/terminfo or something related in tin.

The proper way to fix it would be to find out WHAT causes it to output that "Do you want to abort this operation? (y/N) N" message. Should be not all that difficult after all.

I would've fixed it myself but simply don't have time to dig into it and trying to understand how that terminal code works in tin. It is mostly working in konsole so I can live with it for a time being. Awkward and inconvenient but not totally screwed as it is in gnome/mate.

Comment 11 Dominik 'Rathann' Mierzejewski 2024-02-16 15:13:40 UTC
Indeed. Apparently, recent change in terminfo exposed this bug, reassigning back to tin. I'll go back to tin upstream and try to figure it out. It is reproducible in xterm.

For now, a good work-around is to set:

use_mouse=OFF

in ~/.tin/tinrc

Comment 12 Thomas E. Dickey 2024-02-18 00:12:11 UTC
Upstream supposes this to be the issue reported in October here:

https://github.com/vim/vim/pull/13440

and resolved here:

https://lists.gnu.org/archive/html/bug-ncurses/2023-10/msg00117.html

(Fedora package maintainers might want to apply a small change to terminfo)

Comment 13 Dominik 'Rathann' Mierzejewski 2024-02-23 11:16:56 UTC
I can confirm this is fixed in Fedora 40 with ncurses 6.4-12.20240127.fc40, so a backport to Fedora 38 and 39 would be appreciated. Reassigning to ncurses.

Comment 14 Thomas E. Dickey 2024-02-24 20:54:21 UTC
Updating misc/terminfo.src to 20231028 would be the simplest change.

https://github.com/ThomasDickey/ncurses-snapshots/commit/0daa37c5fb53ac883424599b93fa152f23643398
https://github.com/ThomasDickey/ncurses-snapshots/commit/0daa37c5fb53ac883424599b93fa152f23643398#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7

diffs to terminfo.src may look "large", but that's mostly due to formatting.

Comment 15 Miroslav Lichvar 2024-02-27 09:55:54 UTC
Thanks for the suggestion. I'll prepare updates for F38 and F39.

Comment 16 Fedora Update System 2024-02-27 10:07:39 UTC
FEDORA-2024-399b399916 (ncurses-6.4-7.20230520.fc39.1) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-399b399916

Comment 17 Fedora Update System 2024-02-27 10:07:41 UTC
FEDORA-2024-9e02bc2225 (ncurses-6.4-7.20230520.fc38.1) has been submitted as an update to Fedora 38.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-9e02bc2225

Comment 18 Fedora Update System 2024-02-28 01:03:41 UTC
FEDORA-2024-399b399916 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-399b399916`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-399b399916

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2024-02-28 02:10:50 UTC
FEDORA-2024-9e02bc2225 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-9e02bc2225`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-9e02bc2225

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2024-03-01 01:08:51 UTC
FEDORA-2024-399b399916 (ncurses-6.4-7.20230520.fc39.1) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2024-03-14 01:38:59 UTC
FEDORA-2024-9e02bc2225 (ncurses-6.4-7.20230520.fc38.1) has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.