Skip to content

ArgumentOutOfRangeException if autocomplete wraps in VSCode #11511

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

Closed
ericwj opened this issue Jan 7, 2020 · 5 comments
Closed

ArgumentOutOfRangeException if autocomplete wraps in VSCode #11511

ericwj opened this issue Jan 7, 2020 · 5 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-External The issue is caused by external component(s).

Comments

@ericwj
Copy link

ericwj commented Jan 7, 2020

Steps to reproduce

In Visual Studio Code, do dir near the right end of the terminal window and type C:\win, hitting tab to autocomplete into any directory until the exception occurs. The same happens with other commands when it wraps pressing Tab to autocomplete the parameter name or the value.

In Windows Terminal, this works - no exception occurs. Although the output may be garbled while editing the command, depending on how big the window is.

"  <as many spaces as necessary to get near the right margin> "; dir "C:\Windows\assembly\NativeImages_v4.0.30319_32\Sys"

Hit Tab.

Expected behavior

The path wraps and the autocomplete leaves the cursor at the end of the autocompleted name.

Actual behavior

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 'top')Actual value was 20.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.InsertInput(StringBuilder inputLine, Int32 promptStartCol, Int32 promptStartRow, String insertedInput, Int32 cursorIndex, Int32 insertIndex, Int32 replaceLength, Int32 finalCursorIndex)
   at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.ReadLine(Boolean isCommandLine, CancellationToken cancellationToken)
   at Microsoft.PowerShell.EditorServices.EditorServicesPSHostUserInterface.StartReplLoop(CancellationToken cancellationToken)

The cursor will be after a new prompt and the command that was being constructed is lost completely.

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.1
PSEdition                      Core
GitCommitId                    7.0.0-rc.1
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

$Host

Name             : Visual Studio Code Host
Version          : 2019.12.0
InstanceId       : 0f133d7e-f721-4390-9231-955d3fefc0a2
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.EditorServices.EditorServicesPSHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Help | About
image

Could say this is a VSCode issue but the stacktrace in fact doesn't have anyhting VSCode related in it.

@ericwj ericwj added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Jan 7, 2020
@iSazonov
Copy link
Collaborator

iSazonov commented Jan 7, 2020

@ericwj I guess you should move the issue to https://github.com/PowerShell/PowerShellEditorServices

GitHub
A common platform for PowerShell development support in any editor or application! - PowerShell/PowerShellEditorServices

@kaluaabyss
Copy link

Duplicated with PS 5.1 in VSCode by just entering characters (no tab). Around the 160th character the error will be returned.

$PSVersionTable
Name Value


PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

$host
Name : Visual Studio Code Host
Version : 2019.12.0
InstanceId : e60875d2-b4cd-438e-a528-d0d25e842ad9
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.EditorServices.EditorServicesPSHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

@iSazonov
Copy link
Collaborator

@rjmholt Is the issue external?

@rjmholt
Copy link
Collaborator

rjmholt commented Jan 15, 2020

This is PowerShell/vscode-powershell#702

@rjmholt rjmholt added the Resolution-External The issue is caused by external component(s). label Jan 15, 2020
@ghost
Copy link

ghost commented Jan 16, 2020

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

@ghost ghost closed this as completed Jan 16, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-External The issue is caused by external component(s).
Projects
None yet
Development

No branches or pull requests

4 participants