-
Notifications
You must be signed in to change notification settings - Fork 316
Closed
Description
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 the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 87 Keys:
& Space C : / U s e r s / h i n d a / a n a c o n d a 3 / p y t h o n . e x e Space " d : / P r o j e c t s / J . A . R . V . I . S Space L o c a l / B r a i n / A I B r a i n . p y " Enter
Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Actual value was -2.
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)
Screenshot
N/A – As instructed, no screenshot of the exception report. Console window was executing a Python script when this occurred.
Environment data
& {
$hostName = $Host.Name
if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
$id = $PID; $inWindowsTerminal = $false
while ($true) {
$p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
if (!$p -or !$p.Name) { break }
if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
$id = $p.ParentProcessId
}
if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
}
$m = Get-Module PSReadline
$v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
if ($pre) { $v = "$v-$pre" }
$os = if ($IsLinux -or $IsMacOS) { uname -a } else { (dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion }
Write-Host ''
Write-Host "PS Version: $($PSVersionTable.PSVersion)"
Write-Host "PS HostName: $hostName"
Write-Host "PSReadLine Version: $v"
Write-Host "PSReadLine EditMode: $((Get-PSReadLineOption).EditMode)"
Write-Host "OS: $os"
Write-Host "BufferWidth: $([console]::BufferWidth)"
Write-Host "BufferHeight: $([console]::BufferHeight)"
Write-Host ''
}
Steps to reproduce
(base) C:\Users\hinda\OneDrive\Desktop>& C:/Users/hinda/anaconda3/python.exe "d:/Projects/J.A.R.V.I.S Local/Brain/AIBrain.py"
& was unexpected at this time.
Expected behavior
The Python script runs successfully or throws a Python error, but does not crash the PowerShell input system.
Actual behavior
An unhandled ArgumentOutOfRangeException crashes PSReadLine, halting PowerShell input.
Metadata
Metadata
Assignees
Labels
No labels