You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #884, and is easiest in a limited buffer size terminal, such as the current Windows Terminal or VS Code's terminal, enter a long line of text on the last line of the buffer, but before filling it, arrow back one character, and then extend the line to the end of the buffer.
Then press END, and an exception will occur. I'm pretty sure it occurs because the desired cursor position is calculated to be the beginning of the next line, but that is beyond the end of the buffer, and no rendering event has occurred to be able to fix that.
Exception
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was 28.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.MoveCursor(Int32 newCursor)
at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
ReallyRender() handles landing in this position by forcing a newline, but MoveCursor() doesn't have any handling for that.
I was able to replicate this issue in ConsoleHost, if I filled up the 9000 line buffer first.
Interestingly, it appears that most these terminals support emitting text in to the last character of the last line without the cursor bumping up the lines. However, the SetCursorPosition, doesn't seem to allow moving the cursor in to this condition. Evidently VS Code's terminal does not support this (my error while testing), even though its a well known ANSI terminal feature from more than 20 years ago. It allows you to write the very last character cell on the screen without the screen scrolling.
The text was updated successfully, but these errors were encountered:
msftrncs
added a commit
to msftrncs/PSReadLine
that referenced
this issue
Nov 2, 2019
Handle when `MoveCursor()` attempts to move the cursor to the end of the
terminal buffer, same as `Render()`, by issueing a line feed to force a
scroll.
FixesPowerShell#1144.
Handle when `MoveCursor()` attempts to move the cursor to the end of the
terminal buffer, same as `Render()`, by issueing a line feed to force a
scroll.
FixesPowerShell#1144.
msftrncs
added a commit
to msftrncs/PSReadLine
that referenced
this issue
Nov 8, 2019
Handle when `MoveCursor()` attempts to move the cursor to the end of the
terminal buffer, same as `Render()`, by issueing a line feed to force a
scroll.
FixesPowerShell#1144.
Uh oh!
There was an error while loading. Please reload this page.
Environment data
Steps to reproduce or exception report
Similar to #884, and is easiest in a limited buffer size terminal, such as the current Windows Terminal or VS Code's terminal, enter a long line of text on the last line of the buffer, but before filling it, arrow back one character, and then extend the line to the end of the buffer.
Then press END, and an exception will occur. I'm pretty sure it occurs because the desired cursor position is calculated to be the beginning of the next line, but that is beyond the end of the buffer, and no rendering event has occurred to be able to fix that.
Exception
ReallyRender()
handles landing in this position by forcing a newline, butMoveCursor()
doesn't have any handling for that.I was able to replicate this issue in ConsoleHost, if I filled up the 9000 line buffer first.
Interestingly, it appears that most these terminals support emitting text in to the last character of the last line without the cursor bumping up the lines. However, the SetCursorPosition, doesn't seem to allow moving the cursor in to this condition.
Evidently VS Code's terminal does not support this(my error while testing), even though its a well known ANSI terminal feature from more than 20 years ago. It allows you to write the very last character cell on the screen without the screen scrolling.The text was updated successfully, but these errors were encountered: