Skip to content

Windows 11 PowerShell-style mouse selection parity #211

@jun2077681

Description

@jun2077681

Summary

The client-side rsel drag selection (blue overlay, pwsh-style) has a few behavioural gaps compared to Windows 11's native PowerShell selection in Windows Terminal:

  1. Pane boundary bleed: the overlay spans the full terminal width on intermediate rows, so dragging inside a pane visually bleeds into neighbouring panes on multi-line selections.
  2. Forced copy-on-release: rsel always copies to the clipboard and clears the selection on mouse-up. Windows 11 PowerShell keeps the selection visible until an explicit copy action (right-click, Ctrl+C, Ctrl+Shift+C), letting users refine the selection or dismiss it with a click.
  3. No multi-click word/line selection: double-click / triple-click do nothing special. Native terminals expand to a word / line.
  4. No modifier-extend: Windows 11 uses Shift+click to extend an existing selection — unfortunately Windows Terminal reserves Shift+click for its own native selection override, so this needs a different modifier (Ctrl+click is a natural fallback).
  5. No block selection: Alt+drag does not produce a rectangular selection.
  6. No Ctrl+Shift+C / Ctrl+Shift+V / smart Ctrl+C bindings tied to the rsel state.

Item 1 is a latent rendering bug (intermediate rows iterate 0..=area.width-1 regardless of pane rect). Items 2-6 are behaviour the existing rsel path was never designed for but are expected by users coming from Windows 11 PowerShell.

Proposal

Add a new pwsh-mouse-selection session option (boolean, default off) that opts into Windows 11 PowerShell-parity behaviour:

  • Pane-aware clipping (fixes pwsh is not default installed #1 for anyone with the option on)
  • Selection persists after mouse-up; copy only on right-click / Ctrl+Shift+C / smart Ctrl+C
  • Double-click word / triple-click line selection (within the originating pane)
  • Ctrl+click extends the current selection to the click point
  • Alt+drag produces a rectangular (block) selection
  • Ctrl+Shift+C, Ctrl+Shift+V, and smart Ctrl+C (copy-if-selected, SIGINT otherwise) key bindings
  • White overlay (closer to Windows Terminal's native selection colour)

Default stays off so existing users see zero behavioural change.

Environment

  • psmux version: 3.3.2
  • Terminal: Windows Terminal
  • OS: Windows 11

Notes

  • Shift+click cannot be reclaimed because Windows Terminal hardcodes it as a native selection override regardless of mouse tracking state. Ctrl+click is used instead.
  • Auto-scroll during drag at pane edges is out of scope — rsel operates on visible content only, and scrolling the scrollback buffer belongs to copy mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions