microsoft / microsoft/terminal

Allow remapping of experimental.repositionCursorWithMouse to use key bindings such as Alt + Left Click

Open
#17,907 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Settings 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

I'm aware that as of now, by setting `experimental.repositionCursorWithMouse` as `true`, we are able to move the cursor to the mouse's position with a simple left click. However, there are times when I want to simply click on the terminal to get it into focus without moving the cursor around. Hence, I think it would be best to let the user choose what keys would be best for them to utilize this feature, for eg. Alt+Left Click/Ctrl+Left Click/Middle Click.

# Proposed technical implementation details (optional)

I'm aware that mouse key bindings are currently not available yet as explained in #1553. However, once they are available, I'd really love it if we can have a command such as `moveCursorWithMouse` and not just `experimental.repositionCursorWithMouse` as a profile setting just like how we have [`showContextMenu`](https://learn.microsoft.com/en-us/windows/terminal/customize-settings/actions#open-context-menu) as a command that can be mapped to a key binding and not just the profile setting `experimental.rightClickContextMenu`.

So maybe we could have something like this in the future:
```json
{ "command": "moveCursorWithMouse", "keys": "alt+left_click" }
```

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

Review the existing experimental.repositionCursorWithMouse setting and the mouse-binding limitation described in #1553. Compare the proposed moveCursorWithMouse command with the existing showContextMenu command; done means users can choose a mouse/key combination without losing the ability to focus the terminal without repositioning the cursor.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.