Skip to content

Closing } on pasted function is displayed on wrong line if windows has scrolled in Windows Terminal #4874

@mrenton999

Description

@mrenton999

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

Pasting a simple function looks fine if the screen has not scrolled, but if it has scrolled, the closing } line shows up overlaid onto the last line of the function. (This could be a PSReadLine problem or a Windows Terminal problem.)
Unscrolled, showing the pasted text by MOREing it to temp.temp:

Image

Scrolling by just standing on Enter, then doing the paste again:

Image

Environment data

PS Version: 7.5.2
PS HostName: ConsoleHost
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 180
BufferHeight: 9001

Steps to reproduce

Just write a simple function starting with "function name {" and ending with "}" alone on a line, and paste it into PS

Expected behavior

The echoed-back function looks right

Actual behavior

If you paste it in an unscrolled window, it's right.
If you've scrolled down a bit and paste it, the last line ("}") is displayed atop the penultimate line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions