-
Notifications
You must be signed in to change notification settings - Fork 312
ArgumentOutOfRangeException on VSCode terminal PS 7.0 #1758
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
Comments
try to upgrade : |
Thanks @tonybounty it seems that upgrading PSReadLine fixed the issue for me. However, I had this problem in Windows Terminal, not in VSCode terminal. |
This doesn't seem to correct the issue when using the terminal in VSCode. Is this the correct place to report those errors, as well? |
Yeah, that's true, this thread is about VSCode, not Windows Terminal. Sorry for a bit misplaced comment, I just was thankful to find solution to my problem. |
@jagdishrajan Sorry for not being able to get to this issue earlier. I know it's been a long time, but if it's possible, could you please answer a few questions below to help us investigate the exception?
& {
$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)" }
}
"`nPS version: $($PSVersionTable.PSVersion)"
$m = Get-Module PSReadline
$v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
if ($pre) { $v = "$v-$pre" }
"PSReadline version: $v"
if ($IsLinux -or $IsMacOS) {
"os: $(uname -a)"
} else {
"os: $((dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion)"
}
"PS file version: $($name = if ($PSVersionTable.PSEdition -eq "Core") { "pwsh.dll" } else { "powershell.exe" }; (dir $pshome\$name).VersionInfo.FileVersion)"
"HostName: $hostName"
"BufferWidth: $([console]::BufferWidth)"
"BufferHeight: $([console]::BufferHeight)`n"
} Thanks in advance for your help! |
@daxian-dbw, here are the results of the script. To be honest I haven't seen the error in a while, so I assume it got fixed in one of the updates to VSCode, where I typically run PowerShell. PS version: 7.0.3 |
@jagdishrajan Thanks for sharing the environment data. Unfortunately, I cannot reproduce the exception with the Given that, I will close this issue for now. If you run into a similar exception in future, please kindly open another issue, with the exception output, environment data, and the repro steps (also a screenshot of the console right before the exception message if possible). That would be extremely helpful to our investigation. Thank you! |
Mark this as a duplicate of #2298 |
Environment
PSReadLine: 2.0.2
PowerShell: 7.0.3
OS: Microsoft Windows 10.0.18362
Last 200 Keys
Exception
The text was updated successfully, but these errors were encountered: