Skip to content

Exception thrown in stout VS Code Integrated Console right arrow while looking at autocomplete on path #2932

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
3 tasks done
mavaddat opened this issue Oct 25, 2021 · 1 comment

Comments

@mavaddat
Copy link

mavaddat commented Oct 25, 2021

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

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.        
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md
Thank you!

### Environment
PSReadLine: 2.1.0
PowerShell: 2021.10.1
OS: Microsoft Windows 10.0.22483
BufferWidth: 117
BufferHeight: 12

Last 200 Keys

 LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Enter
 UpArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow \ LeftArrow * Enter
 UpArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow \ LeftArrow * Enter
 UpArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete a p p Tab m s Tab RightArrow RightArrow RightArrow LeftArrow LeftArrow RightArrow Enter
 Ctrl+a Delete $ e n v : L O C A L A P P Tab \ Backspace Ctrl+a Ctrl+x $ e n v : L O C A L A P P D A T A \ E d Tab Backspace Backspace M i r Backspace c Tab E Tab Enter
 Backspace Spacebar Backspace Tab RightArrow Enter
 U s e r Tab Spacebar Backspace Tab Escape Backspace P r e Tab Backspace Backspace Backspace P r e Tab Delete ' LeftArrow Ctrl+w Tab UpArrow RightArrow DownArrow RightArrow LeftArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace t Backspace Tab RightArrow

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 'top')
Actual value was -1.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.Menu.DrawMenu(Menu previousMenu, Boolean menuSelect)
   at Microsoft.PowerShell.PSConsoleReadLine.MenuCompleteImpl(Menu menu, CommandCompletion completions)
   at Microsoft.PowerShell.PSConsoleReadLine.PossibleCompletionsImpl(CommandCompletion completions, Boolean menuSelect)
   at Microsoft.PowerShell.PSConsoleReadLine.CompleteImpl(Boolean menuSelect)
   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)

Screenshot

Screenshot of first exception:

First exception

Screenshot of second exception:

Second exception

Animation of the exception generation

Environment data

PS Version: 7.1.5
PS HostName: Visual Studio Code Host
PSReadLine Version: 2.1.0
PSReadLine EditMode: Windows
OS: 10.0.22483.1000 (WinBuild.160101.0800)
BufferWidth: 117
BufferHeight: 10

PowerShell Preview Extension version: 2021.10.1
VS Code version: Code - Insiders 1.62.0-insider (bcb9df5afa52c5b713f62e86dcac2c5050504b5f, 2021-10-22T05:15:25.330Z)
OS version: Windows_NT x64 10.0.22483
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz (4 x 2990)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.91GB (5.94GB free)
Process Argv --crash-reporter-id 283c6689-32a9-4a0e-be89-cbd962d5dd31
Screen Reader no
VM 0%
A/B Experiments

vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
pythonvspyt602:30291494
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30291487
pythontb:30258533
pythonvspyt551cf:30291413
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
pythonvsuse255:30319630
vscod805:30301674
pythonvspyt200:30323110
vsccppwt:30382699
pythonvssor306:30340298
bridge0708:30335490
pygetstartedt2:30353727
bridge0723:30353136
pythonrunftest32:30365365
pythonf5test824:30361779
javagetstartedt:30350119
pythonvspyt187:30365360
pydsgst2:30361790
vsaa593cf:30376535
vscrecpromptt2:30387008

Contents of Directory $env:LOCALAPPDATA\Microsoft\Edge Beta\User Data:

Name Mode
Ad Blocking d----
Application Guard d----
CertificateRevocation d----
Crashpad d----
Default d----
Edge Shopping d----
GrShaderCache d----
hyphen-data d----
OriginTrials d----
RecoveryImproved d----
Safe Browsing d----
ShaderCache d----
SmartScreen d----
Speech Recognition d----
Subresource Filter d----
Trust Protection Lists d----
Web Notifications Deny List d----
WidevineCdm d----
ZxcvbnData d----
BrowserMetrics-spare.pma -a---
CrashpadMetrics-active.pma -a---
CrashpadMetrics.pma -a---
First Run -a---
FirstLaunchAfterInstallation -a---
Functional Data -a---
Functional Data-wal -a---
Functional SAN Data -a---
Functional SAN Data-wal -a---
Last Browser -a---
Last Version -a---
Local State -a---
lockfile -a---

Output of Get-PSReadLineOption:

EditMode ContinuationPrompt ContinuationPromptColor ExtraPromptLineCount AddToHistoryHandler CommandValidationHandler CommandsToValidateScriptBlockArguments HistoryNoDuplicates MaximumHistoryCount MaximumKillRingCount HistorySearchCursorMovesToEnd ShowToolTips DingTone CompletionQueryItems WordDelimiters DingDuration BellStyle HistorySearchCaseSensitive ViModeIndicator ViModeChangeHandler HistorySavePath HistorySaveStyle PredictionSource AnsiEscapeTimeout PromptText DefaultTokenColor CommentColor KeywordColor StringColor OperatorColor VariableColor CommandColor ParameterColor TypeColor NumberColor MemberColor EmphasisColor ErrorColor SelectionColor InlinePredictionColor
Windows >> �[37m 0 System.Func`2[System.String,System.Object] System.Collections.Generic.HashSet`1[System.String] True 10000 10 True True 1221 100 ;:,.[]{}()/\|^&*-=+'"–—― 50 Audible False None C:\Users\mavad\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\Visual Studio Code Host_history.txt SaveIncrementally History 100 �[37m �[32m �[92m �[36m �[90m �[92m �[93m �[90m �[37m �[97m �[97m �[96m �[91m �[30;47m �[38;5;238m

Steps to reproduce

  1. Open VS Code or VS Code Insiders with PowerShell Preview extension.
  2. Stage the following string in the PowerShell Integrated Console terminal at the current prompt (it doesn't matter that the string is not " terminated):
& "$env:LOCALAPPDATA\Microsoft\Edge Beta\User Data\
  1. Press tab to autocomplete the end of the line.
  2. Press any of the directional arrows ← ↑→↓ on the keyboard to navigate to Autocomplete suggestions

Expected behavior

  • Able to use directional arrows ← ↑→↓ on the keyboard to navigate to Autocomplete suggestions.
  • Able to navigate the autocomplete results with automatic scrolling down in the terminal if necessary.

Actual behavior

After an indeterminate number of arrows traversing the results, there is an exception thrown.

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 25, 2021
@mavaddat mavaddat changed the title Right arrow while looking at autocomplete on path Exception thrown in stout VS Code Integrated Console right arrow while looking at autocomplete on path Oct 25, 2021
@daxian-dbw
Copy link
Member

@mavaddat I cannot reproduce the issue you reported. Some fixes to the menu completion was done in 2.2.0-beta2 (PR #1946), and it's likely the issue you ran into was already addressed.

Can you please update the PowerShell Preview VSCode extension to the latest version (updated on 11/3/2021)? The latest PowerShell Preview extension bundles the 2.2.0-beta4 version of PSReadLine. Please try that version and see it still reproduces for you. I will close this issue for now, and please open a new one if you ran into anything with the 2.2.0-beta4 PSReadLine.

Thanks again for the well-written issue report!

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants