microsoft / microsoft/terminal

Allow mouse clicks to reposition cursor by emitting cursor key sequences

Open
#8,573 65 comments 37 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[!IMPORTANT]
📌 Maintainer TL;DR:
This got added in #15758, as "experimental.repositionCursorWithMouse":true. See also https://github.com/microsoft/terminal/issues/8573#issuecomment-2035495548


Description of the new feature/enhancement

Windows Terminal version: 1.4.3243.0
Windows Version: Microsoft Windows [Version 10.0.19042.630]
Also using:
    GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin) under cygwin
    GNU bash, version 4.4.23(2)-release (x86_64-pc-msys) under msys2
    GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) under Ubuntu 20.04 WSL 2

It is not possible to place the cursor with the mouse in any of these shells under Windows Terminal. It is, however, quite possible to do this when running bash with msys2, cygwin or wsl on mintty (or WSL terminal).

This issue was discussed in #4268, where it was dismissed because I'm not sure I know of any shell application that actually supports that tbh.. This is patently not the case as it is supported in the integrations between bash and mintty (and the same bash as used by mintty is being loaded in Windows Terminal).

Mouse support was tracked in #376, #545 and #5177. There was a pull request in #/pull/4859 to close some of these issues, however cursor placement still doesn't appear to work in the applications I listed.

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 reviewing the original mouse-support discussion and the implementation referenced in #15758, including the experimental.repositionCursorWithMouse setting. Verify whether the setting already emits cursor key sequences for the listed bash environments; done means cursor placement works as requested, but the feature is already reported as added.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, cpp
Domain
cli, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.