vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Error when command input exceeds window size

Open daleecc opened this issue 9 years ago • 3 comments

System Details

  • Operating system name and version: Windows 7 (64-bit)
  • VS Code version: 1.12.1
  • PowerShell extension version: 1.0.0
PS > code -v

1.12.1
f6868fce3eeb16663840eb82123369dec6077a9b
PS > $pseditor.EditorServicesVersion


Major  Minor  Build  Revision
-----  -----  -----  --------
1      0      0      0


PS > code --list-extensions --show-versions

[email protected]
[email protected]
[email protected]
PS > $PSVersionTable


Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When typing commands into the integrated terminal, if the edge of the window is reached (i.e. the command would wrap onto the next line), the error below occurs and the command will not execute.

An error occurred while reading input:

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 3000.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.InsertInput(StringBuilder inputLine, Int32 promptStartCol, Int32 promptStartRow, String insertedInput, Int32 cursorInde
x, Int32 insertIndex, Int32 replaceLength, Int32 finalCursorIndex)
   at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.<ReadLine>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerShell.EditorServices.Console.ConsoleService.<StartReplLoop>d__21.MoveNext()

daleecc avatar May 16 '17 09:05 daleecc

Thanks @daleecc! Looks like this is being tracked by #702, I'll close this issue in favor of that one.

daviwil avatar May 16 '17 13:05 daviwil

Ah sorry I missed that one.

daleecc avatar May 16 '17 13:05 daleecc

No problem!

daviwil avatar May 16 '17 13:05 daviwil