vim / vim

The official Vim repository
https://www.vim.org
Vim License
36.07k stars 5.39k forks source link

Mouse passthrough for ncurses programs with `:term` #12223

Open bolshoytoster opened 1 year ago

bolshoytoster commented 1 year ago

In a normal terminal emulator (or even tmux), programs like htop can read input from a mouse (i.e. click/scroll). Under a vim terminal (opened with :term), with mouse=a, the mouse input is not passed through to programs running under it.

Is there any way to get the vim terminal to pass through mouse events?

zeertzjq commented 1 year ago

This seems to work in kitty, but not in xterm.

bolshoytoster commented 1 year ago

Mouse passthrough seems to work if I run vim or emacs in the terminal, so it might just be ncurses programs that it doesn't work for.

brammool commented 1 year ago

In a normal terminal emulator (or even tmux), programs like htop can read input from a mouse (i.e. click/scroll). Under a vim terminal (opened with :term), with mouse=a, the mouse input is not passed through to programs running under it.

Is there any way to get the vim terminal to pass through mouse events?

The mouse clicks are passed through, it should just work. E.g. when I open a terminal window and run Vim inside it, the mouse can be used to position the cursor.

Perhaps programs where this doesn't work do not enable mouse click reporting? I don't have "htop".

-- No man may purchase alcohol without written consent from his wife. [real standing law in Pennsylvania, United States of America]

/// Bram Moolenaar -- @.*** -- http://www.Moolenaar.net \\ /// \\ \\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\ help me help AIDS victims -- http://ICCF-Holland.org ///

bolshoytoster commented 1 year ago

@brammool did you read my second comment? I acknowledged that it's only some programs that don't work.