How can I enable the mouse for the programs I run on the terminal?

Left and right click don’t work on my terminal programs. And the scrollwheel only works if I set mouse=“”.

Do you mean “in neovim”, or “in terminals” in general?
If the first case,
add set mouse=a in init.vim
or add vim.opt.mouse="a" in init.lua

The question refers specificly when running :term inside nvim. mouse=a doesn’t work on :term.

It seems to work here on my device.

It is tricky: Apparently it seems to depend on the terminal.

On my experience with foot terminal with xterm-256color:

  • mouse=“” makes the scrol work on my terminal.
  • But using mouse=a (see this) and setting TERM to tmux-256color make my terminal applications mouse support work properly, but neovim’s :term itself still won’t work.

So the solution for me would be setting mouse=“” when inside the term, but setting mouse=“a” TERM=tmux-256color before launching my terminal apps.