Psreadline: Right-click paste with \n comes out upside down?

Created on 21 Jan 2017  路  4Comments  路  Source: PowerShell/PSReadLine

When using PSReadLine 1.2, and pasting text that has newlines _without_ carriage returns, the lines come out in reverse order.
2017-01-20_22-32-31

Most helpful comment

Seems to be happening because of this key handler: https://github.com/lzybkr/PSReadLine/blob/master/PSReadLine/KeyBindings.cs#L135
LF is interpreted as Ctrl+Enter and triggers InsertLineAbove which pushes each text line down as the right click paste is getting processed one char at a time. CRLF works fine because CR triggers AcceptLine. Ctrl+V paste works because it inserts all of the clipboard in one go.

Workaround

Remove-PSReadlineKeyHandler Ctrl+Enter

All 4 comments

Seems to be happening because of this key handler: https://github.com/lzybkr/PSReadLine/blob/master/PSReadLine/KeyBindings.cs#L135
LF is interpreted as Ctrl+Enter and triggers InsertLineAbove which pushes each text line down as the right click paste is getting processed one char at a time. CRLF works fine because CR triggers AcceptLine. Ctrl+V paste works because it inserts all of the clipboard in one go.

Workaround

Remove-PSReadlineKeyHandler Ctrl+Enter

Closing in favor of #579 which covers all of the known issues with right-click paste.

Windows 10, 1909, just got bit by this bug.

How and why is this not fixed more than 3 years after being reported?

Was this page helpful?
0 / 5 - 0 ratings