Ticket #3954 (new defect)

Opened 7 months ago

Last modified 2 weeks ago

mc compiled with ncurses support does not handle mouse

Reported by: kloczek Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: 4.8.21
Keywords: Cc: egmont
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Fedora rawhide, ncurses-6.1-8.20180923

When configures --with-screen=ncurses does not handle scroll, and clicks mouse events emitting in mc command line terminal sequences

Change History

comment:1 Changed 7 months ago by kloczek

Another issue: alt-n and alt-p (next, prev command line from history) does not refresh command line. Cursor is moved to the end of the command but whole command is just blank string.

comment:2 Changed 6 months ago by kloczek

Just checked and bug still is present in 4.8.22.

comment:3 Changed 3 weeks ago by kloczek

Just checked and bug still is present in 4.8.23 :(

comment:4 Changed 3 weeks ago by egmont

I've just tried and it works for me as expected (Ubuntu 19.04, mc-4.8.23 compiled from source against ncursesw).

Could you please give more details: Do you take mc from Rawhide or compile it yourself? What terminal emulators? Does it work in other terminals? What does mc --help say? What does ldd /path/to/mc | grep ncurses report?

Another issue

One issue per report, please. Feel free to open a new one for alt-n/alt-p. (By the way, they also work for me.)

comment:5 Changed 3 weeks ago by andrew_b

Perhaps this is depending on ABI version (5 or 6).

comment:6 Changed 3 weeks ago by kloczek

So just FTR .. I'm using 6.

comment:7 Changed 3 weeks ago by andrew_b

In ncurses-5:

$ infocmp xterm | grep kmous
	kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~,

In ncurses-6:

$ infocmp xterm | grep kmous
	kind=\E[1;2B, kmous=\E[<, knp=\E[6~, kpp=\E[5~,

Why?

As a result, in case of ncurses-6 we have

(gdb) p xmouse_seq
$7 = 0x75559a "\033[<"
(gdb) p xmouse_extended_seq
$8 = 0x4c487f "\033[<"
Last edited 3 weeks ago by andrew_b (previous) (diff)

comment:8 follow-up: ↓ 9 Changed 2 weeks ago by egmont

  • Cc egmont added

Not sure how to check the ABI version. I have ncurses 6.1+20181013 (Ubuntu 19.04) and infocmp reports kmous=\E[M.

Not sure how terminfo description is relevant per se, probably not, since as far as I recall mc uses its own mouse parsing (I might remember incorrectly or miss something). It could be however that ncurses ABI 6 defaults to extended SGR 1006 mouse mode, and this somehow conflicts with mc also explicitly enabling this mode. No idea though how switching to this mode twice could be harmful, further debugging is needed.

comment:9 in reply to: ↑ 8 Changed 2 weeks ago by andrew_b

Replying to egmont:

Not sure how to check the ABI version.

As I can see in deb rules, ABI version is 6.

comment:10 Changed 2 weeks ago by kloczek

Just for FTR:

$ infocmp | grep kmous

kind=\E[1;2B, kmous=\E[<, knp=\E[6~, kpp=\E[5~,

$ echo $TERM
xterm-256color

Note: See TracTickets for help on using tickets.