microsoft / microsoft/terminal

Add fine-grained mouse report configurability like iTerm2

Open
#8,710 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Settings Area-TerminalControl Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

Description of the new feature/enhancement

First of all: congrats on the tmux support you have so far, it's pretty great already out of the box!
Lots of things "just work" right away, including with mouse reporting:

  • using the mouse wheel works great (with the usual/typical tmux copy-mode)
  • mouse reporting works perfectly well in tools like vim
  • I was able to even easily make my favorite tmux window navigation shortcut work with this in my settings:
{ "command": {"action": "sendInput", "input": "\u001b[1;3C" }, "keys": "alt+right" },
{ "command": {"action": "sendInput", "input": "\u001b[1;3D" }, "keys": "alt+left" },

Where it's not working well unfortunately is when trying to simply select some text while under tmux (ie: simply click+drag -> nothing happens).
Mouse reporting also does not work outside of tools like vim (ie: click on a tmux pane or window -> nothing happens)

Usually with tmux, when mouse reporting is completely transferred to tmux, then one can switch panes/windows by clicking (but one does lose the click+drag usual text selection method in that case).

My favorite mode with tmux integration is something that latest iTerm2 does on macos: one can enable mouse reporting for tmux, but limit it to wheel events only. That way, I can:

  • use click+drag to select text (as-if tmux wasn't running at all)
  • use mouse wheel to trigger the copy-mode in tmux and scroll through tmux output history (this works perfectly well currently in WindowsTerminal!)

Proposed technical implementation details (optional)

Feature request: can you make it so that one can choose to pass through mouse wheel events only to tmux?
Perhaps a new optional setting such as:

"mouseReporting": "enabled|disabled|wheelOnly"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing mouse-reporting and tmux integration entry points, focusing on how wheel events differ from click and drag events. Compare the current behavior with the requested enabled, disabled, and wheelOnly modes. Done means a configurable wheel-only mode lets tmux receive mouse-wheel events while ordinary click-and-drag text selection remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.