Skip to content

Feature Request: Add mouse events to PowerShell Engine #1982

@pcgeek86

Description

@pcgeek86

Originally posted here: PowerShell/PowerShell#14247

It was recommended to move this to PSReadLine.

Description of the new feature/enhancement

Whereas:

  1. Both tmux and PowerShell are terminal-based applications
  2. tmux supports mouse events, such as click-and-drag to resize panes, select a window, and scroll through history
  3. PowerShell scripts could benefit from mouse interactions

Proposed technical implementation details (optional)

This might be implemented using a PowerShell "engine event."

Right-Click Event

The right-click event should include event data that describes the terminal coordinates of the click event.

Register-EngineEvent -Action { Draw-ContextMenu -At $event.Coordinates } -SourceIdentifier [System.Management.Automation.PsEngineEvent]::RightClick

Scroll Event

The scroll up/down event should include event data about the speed / length / height (???) of the scroll.

Example

Register-EngineEvent -Action { GrabAndDisplay-SomeHistoricalLogData } -SourceIdentifier [System.Management.Automation.PsEngineEvent]::ScrollUp

Click Event

The click event should support both a single click and double-click events. Both should include terminal coordinates where the event occurred.

Register-EngineEvent -Action { Perform-AnAction -At $event.Coordinates } -SourceIdentifier [System.Management.Automation.PsEngineEvent]::DoubleClick

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions