Ticket #4144 (new defect) — at Version 2

Opened 5 years ago

Last modified 19 months ago

mouse clicks don't work on ncurses-6.2, generate garbage to stdout

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

Description (last modified by slyfox) (diff)

It's forward of downstream https://bugs.gentoo.org/753578 report.

When mc is built with ncurses-6.2 mouse keypresses in xterm don't work and generate garbage output. The following workaround seems to be enough to fix it locally:

  • lib/tty/key.c

    a b tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block) 
    21242124        gboolean extended = c == MCKEY_EXTENDED_MOUSE; 
    21252125 
    21262126#ifdef KEY_MOUSE 
    2127         extended = extended || (c == KEY_MOUSE && xmouse_seq == NULL 
    2128                                 && xmouse_extended_seq != NULL); 
     2127        extended = extended || (c == KEY_MOUSE && xmouse_extended_seq != NULL); 
    21292128#endif /* KEY_MOUSE */ 
    21302129 
    21312130        xmouse_get_event (event, extended); 
$ LANG=C ./src/mc --version
GNU Midnight Commander 4.8.25-59-ga2bccac62
Built with GLib 2.64.5
Built with ncursesw 6.2
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Some details:

$ tput kmous | cat -v
^[[<
$ echo $TERM
xterm-256color

Actual generated sequences by xterm are in form of "\e[<0;10;28M", but mc expects-non-extended form of "\e[bxy".

Change History

comment:1 Changed 5 years ago by andrew_b

  • Cc egmont added
  • Component changed from mc-core to mc-tty

Related to #3954.

comment:2 Changed 5 years ago by slyfox

  • Description modified (diff)

Posted initially from the wrong terminal. Updated to expected:

$ tput kmous | cat -v
^[[<
Note: See TracTickets for help on using tickets.