Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic help rendering behaves incorrectly when buffer scrolling is required #2950

Closed
3 tasks done
daxian-dbw opened this issue Nov 4, 2021 · 1 comment · Fixed by #2951
Closed
3 tasks done

Dynamic help rendering behaves incorrectly when buffer scrolling is required #2950

daxian-dbw opened this issue Nov 4, 2021 · 1 comment · Fixed by #2951

Comments

@daxian-dbw
Copy link
Member

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

No exception, but the rendering is incorrect.

Screenshot

As is shown in the GIF below, the cursor position is off when the dynamic help rendering needs buffer scroll-up.
This is because when it comes to adjust the cursor position, the code doesn't take into account the extra physical lines introduced by multi-line text.

Animation

Environment data

PS Version: 7.1.3
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.2.0-beta4
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 133
BufferHeight: 30

Steps to reproduce

  1. Type a number of Enter to move the prompt to the last line of the screen buffer.
  2. Copy get-Command -Name to the line
  3. Press Alt+h to trigger the dynamic in-line help
  4. Press any key to clear the content, and then press Alt+h again.

You will see the cursor position becomes incorrect.

Expected behavior

Cursor position should be at the end of get-Command -Name

Actual behavior

Cursor position becomes incorrect.

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 4, 2021
@ghost ghost added the In-PR A PR is opened targeting the issue label Nov 4, 2021
@daxian-dbw daxian-dbw added this to the 2.2.0-Consider milestone Nov 4, 2021
@ghost ghost added Resolution-Fixed and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. In-PR A PR is opened targeting the issue labels Nov 4, 2021
@ghost
Copy link

ghost commented Jan 7, 2022

🎉 This issue was addressed in 2951, which has now been successfully released in v2.2.0-beta5. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant