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
Define a multi-line prompt, with embedded linebreak of "`n", "`n`r", or [System.Environment]::NewLine. Start typing pretty much anything. if will do. Calling Set-PSReadlineOption -ExtraPromptLineCount 1 before or after did not affect the outcome.
f u n c t i o n Space p r o m p t Space { Space " [ $ ( G e t - L o c a t i o n ) \ ] ` n ` r $ ( " + " * ( G e t - L o c a t i o n Space - S t a c k ) . C o u n t ) > " Space } Enter
i f
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: left
Actual value was -1.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
I hit this with just a long prompt that wrapped because the CWD I was in was long. It happened that prompt ended near the right edge of the console, and the cursor was appearing on its own line.
I entered a command to run to see the output.
Then I UPARROW to edit the command, HOME to move to the beginning of the line, and typed $ as to do a "$t=" to capture the output the command to a variable.
I widened the console window and this did not occur with the same prompt and command sequence.
Activity
perennialmind commentedon Jan 9, 2019
My pwsh was out of date, but testing with Powershell 6.1.1 shows the same behavior.
PS version: 6.1.1
PSReadline version: 2.0.0-beta3
os: 10.0.17134.1 (WinBuild.160101.0800)
PS file version: 6.1.1
gforsman commentedon Jan 31, 2019
I hit this with just a long prompt that wrapped because the CWD I was in was long. It happened that prompt ended near the right edge of the console, and the cursor was appearing on its own line.
I entered a command to run to see the output.
Then I UPARROW to edit the command, HOME to move to the beginning of the line, and typed $ as to do a "$t=" to capture the output the command to a variable.
I widened the console window and this did not occur with the same prompt and command sequence.
daxian-dbw commentedon Sep 13, 2019
Fixed by #979 and #967