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

Open
opened 2026-01-31 08:08:23 +00:00 by claunia · 2 comments
Owner

Originally created by @digitalguy99 on GitHub (Sep 11, 2024).

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 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:

{ "command": "moveCursorWithMouse", "keys": "alt+left_click" }
Originally created by @digitalguy99 on GitHub (Sep 11, 2024). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # 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. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # 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" } ``` <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureArea-SettingsProduct-Terminal labels 2026-01-31 08:08:24 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 12, 2024):

thought: what if we just made it so a click that focuses the window doesn't attempt to move the cursor? I believe we already do that for selections (click-to-focus the window won't start a selection)

@zadjii-msft commented on GitHub (Sep 12, 2024): thought: what if we just made it so a click that focuses the window doesn't attempt to move the cursor? I believe we already do that for selections (click-to-focus the window won't start a selection)
Author
Owner

@digitalguy99 commented on GitHub (Sep 14, 2024):

Good idea, is there a way to do that yet somehow?
But, anyhow, I think it'd be great if we could still choose the key binding especially since in iTerm2, Option+Left Click allows you to move the cursor to mouse position. Similarly, Alt+Left Click on the VSCode terminal would also do the same. I know some people would like to have the same key binding for every app to make it easier to remember.

@digitalguy99 commented on GitHub (Sep 14, 2024): Good idea, is there a way to do that yet somehow? But, anyhow, I think it'd be great if we could still choose the key binding especially since in iTerm2, `Option+Left Click` allows you to move the cursor to mouse position. Similarly, `Alt+Left Click` on the VSCode terminal would also do the same. I know some people would like to have the same key binding for every app to make it easier to remember.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22268