daxian-dbw / PSSandbox

A module to setup a local powershell sandbox session
3 stars 4 forks source link

VSCode crashes with errior in PSReadLine #3

Open daxian-dbw opened 3 years ago

daxian-dbw commented 3 years ago

Using VS Code with PowerShell 7.1 Got this error:

PS C:\Foo> CATR C:\Users\Administrator.RESKIT\DOCUMENTS\POWERSHELL\powershell.config.json
CATR: The term 'CATR' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Suggestion [4,General]: The most similar commands are: cat, cp, cd, dir, copy, clc, cli, clp, clv, cpi.
PS C:\Foo> CAT C:\Users\Administrator.RESKIT\DOCUMENTS\POWERSHELL\powershell.config.json
{"ExperimentalFeatures":["PSCommandNotFoundSuggestion","PSCultureInvariantReplaceOperator"]}
PS C:\Foo> Ge
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: 7.1.0
OS: Microsoft Windows 10.0.20270
BufferWidth: 129
BufferHeight: 15

Last 200 Keys

 E C U T I O N G Tab Backspace Tab Enter
 D I R Spacebar $ P S H O M E Enter
 UpArrow Backspace Backspace Backspace Backspace Backspace Backspace H O M S Backspace E Enter
 UpArrow \ D O C U Tab Ctrl+z M E N T S \ P O W E R S H E L L Enter
 UpArrow \ M I C R O S O F T Tab Tab Tab Tab Tab Tab Tab Tab Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace P Tab Enter
 UpArrow Home Home C A T Delete Delete Enter
 UpArrow Home RightArrow RightArrow RightArrow Delete Enter
 G e t - E x p e r i m e n t a l F e a t u r e Spacebar - N a m e Spacebar * Spacebar | Spacebar Enter
 Spacebar Spacebar S e l e c t - O b j e c t Spacebar - F i r s t Spacebar 1 Spacebar | Enter
 Spacebar Spacebar Spacebar Spacebar E n a b l

### 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 15.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.CalculateWhereAndWhatToRender(Boolean cursorMovedToInitialPos, RenderData renderData, LineInfoForRendering& lineInfoForRendering)
   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(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)

As requested - this is a report.

Environment

Environment

PSReadLine: 2.1.0 PowerShell: 7.1.0 OS: Microsoft Windows 10.0.20270 BufferWidth: 129 BufferHeight: 15

Exception report

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 15.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.CalculateWhereAndWhatToRender(Boolean cursorMovedToInitialPos, RenderData renderData, LineInfoForRendering& lineInfoForRendering)
   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(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)

Steps to reproduce

working in VS COde??

Expected behavior

no error!

Actual behavior

VS Code terminal seems to error.