Skip to content

Allow config so that a right-click paste emits a ctrl+v (or other user defined key sequence) instead #11414

@SteveL-MSFT

Description

@SteveL-MSFT

Description of the new feature/enhancement

Per PowerShell/PSReadLine#579 PSReadLine (which handles the interactive experience for PowerShell) cannot tell that the text is typed or pasted and can only treat it as typed. So newlines gets the input executed which can fail if the content is a multi-line script, for example:

if ($true -eq $false)
{
  'true'
}
else
{
  'false'
}

In this case, PowerShell will accept the individual lines for the if clause, but since else is optional, will execute the if part and then treats else as a command which fails. However, PSReadLine can handle pasting from the clipboard as it knows the entire content of the clipboard rather than seeing it character by character.

So instead of having Ctrl+v or Ctrl+Shift+v bound to terminal paste, let the shell handle it, but have the terminal emit a ctrl+v (or whatever user binding has been defined) on right-click of the mouse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssues related to settings and customizability, for console or terminalArea-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions