Skip to content

Enable Mouse-Based Cursor Navigation & Inline Editing in Command Input #19548

@pushpendras0026

Description

@pushpendras0026

Description of the new feature

Currently, users cannot reposition the cursor within an active command input line in Windows Terminal using the mouse — only the keyboard arrow keys allow navigation.

This feature proposes mouse-based editing support:
allowing developers to click or drag to reposition the cursor, select text, and edit commands inline — without losing focus or breaking input mode.

This would make the Windows Terminal experience faster, more ergonomic, and more consistent with modern IDE-integrated terminals (like Visual Studio Code or JetBrains).

Why this matters

Saves significant time for developers editing long file paths or chained commands.

Reduces repetitive arrow-key navigation and hand strain.

Improves accessibility and typing efficiency for command-line users.

Makes Windows Terminal competitive with modern text interfaces that already support mouse-based editing.

Real-world example

When editing a long PowerShell, Python, or Git command, users must press ←/→ repeatedly to reach a typo.
With this feature, a simple mouse click moves the cursor — just like in any text editor — increasing productivity immediately.

Proposed technical implementation details

This feature would improve inline command editing in Windows Terminal by adding three complementary editing enhancements: mouse-based repositioning, numeric cursor jumps, and improved arrow key behavior.

### Mouse-based repositioning

Left-click moves the text cursor directly to the clicked position within the active input buffer.

Double-click selects the clicked word or token.

Shift + Click or Drag allows text selection inside the command line without losing shell focus.

Works only when the shell is in standard input mode (not during full-screen programs such as vim or less).

Controlled by a user setting, for example:
"mouseEditing": true

Arrow-key enhancements with numeric jumps

Allow prefix numbers to indicate how many positions or words to move.
Example: Alt+5 followed by the Right Arrow moves five words forward.

Extend keybinding logic to recognize numeric prefixes before directional arrows.

Configuration examples:
"jumpKeyCombo": "Alt"
"defaultJumpUnit": "word"

Rapid navigation shortcuts

Support Ctrl + Arrow for word-level jumps.

Optionally support Ctrl + Mouse Wheel for scrolling through command history while maintaining the input cursor.

Provide smoother navigation for long, multi-line commands.

Implementation details

Extend the TerminalInput class (in src/cascadia/TerminalCore/TerminalInput.cpp) to handle mouse events within the active input area.

Map mouse click coordinates to text buffer indices and update the visible cursor position accordingly.

Integrate with the console input pipeline while maintaining compatibility with ConPTY and virtual terminal input modes.

Do not interfere with programs that use mouse reporting sequences (for example \x1b[?1000h).

This feature should be opt-in and backward-compatible. When disabled, the terminal behaves exactly as it does today.
It should remain consistent with existing readline and PSReadLine behavior across PowerShell, CMD, and WSL shells.

Goal
To make command-line editing faster and more ergonomic, allowing users to reposition the cursor, make quick jumps, and edit long commands with minimal keystrokes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions