PowerShell Fast Fails after cloud-hypervisor exits
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by reproducing the crash with zsh -ic 'date' and compare it with the rlwrap workaround. Trace the terminal handling through PSConsoleReadLine.Initialize, ReadKeyThreadProc, and VirtualTerminal.ReadKey, using the reported System.IO.IOException as the failure point. Done means PowerShell remains running after the command exits.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
pwsh -NoProfile -NoLogo -Command "try { [Console]::GetCursorPosition() } catch { Write-Warning 'failed to get cursor position' }"
WARNING: failed to get cursor position
pwsh -NoProfile -NoLogo -Command "try { [Console]::GetCursorPosition() } catch { Write-Warning 'failed to get cursor position' }"
Length Item1 Item2
------ ----- -----
2 0 1
pwsh -NoProfile -NoLogo -Command "try { [Console]::SetCursorPosition( 0 , ([Console]::WindowHeight - 1) ) } catch { Write-Warning 'failed to reposition cursor' }"
matt in dev2 in …/cloud-hypervisor took 42s845ms at 14:27
❯
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.yaml
Thank you!
### Environment
PSReadLine: 2.4.5
PowerShell: 7.6.1
OS: NixOS 25.11 (Xantusia)
BufferWidth: 201
BufferHeight: 25
Last 49 Keys:
c d Spacebar ~ RightArrow Enter
c d Spacebar 0 1 0 Tab Enter
c d Spacebar 3 5 0 Tab Enter
v i Spacebar j u Tab Enter
c l s Backspace Backspace Backspace c l s Spacebar ; Spacebar Backspace Backspace Backspace Enter
j u RightArrow Enter
### Exception
System.IO.IOException: The process cannot access the file because it is being used by another process.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at System.ConsolePal.TryGetCursorPosition(Int32& left, Int32& top, Boolean reinitializeForRead)
at System.Console.get_CursorLeft()
at Microsoft.PowerShell.Internal.VirtualTerminal.get_CursorLeft()
at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)
matt in dev2 in …/cloud-hypervisor took 42s845ms at 14:27 ❯
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will exit.
Unhandled exception. System.IO.IOException: The process cannot access the file because it is being used by another process.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at System.IO.StdInReader.ReadKey()
at System.Console.ReadKey(Boolean intercept)
at Microsoft.PowerShell.Internal.VirtualTerminal.<>c.<ReadKey>b__40_0()
at Microsoft.PowerShell.Internal.VirtualTerminal._TryIgnoreIOE[T](Func`1 f)
at Microsoft.PowerShell.Internal.VirtualTerminal.ReadKey()
at Microsoft.PowerShell.PSConsoleReadLine.ReadOneOrMoreKeys()
at Microsoft.PowerShell.PSConsoleReadLine.ReadKeyThreadProc()
at System.Threading.Thread.StartHelper.Callback(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
^[[25;1R^[[25;3RConnection to dev2 closed.
Screenshot
N/A
Environment data
PS Version: 7.6.1
PS HostName: ConsoleHost
PSReadLine Version: 2.4.5
PSReadLine EditMode: Emacs
OS: Linux dev2 6.18.22 #1-NixOS SMP PREEMPT_DYNAMIC Sat Apr 11 12:26:52 UTC 2026 x86_64 GNU/Linux
BufferWidth: 201
BufferHeight: 25
Steps to reproduce
Run zsh -ic 'date'.
Wrapping the command with rlwrap (e.g. rlwrap zsh -ic 'date') is a workaround.
These issues are likely related:
[https://github.com/dotnet/runtime/issues/59059] (https://github.com/dotnet/runtime/issues/59059)
https://github.com/PowerShell/PowerShell/issues/11215
Expected behavior
PowerShell doesn't crash.
Actual behavior
PowerShell crashes after the command exits.
- Ngôn ngữ chính
- C#
- Star
- 4.4k
- Fork
- 341
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/PSReadLine
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
PowerShell/PSReadLine#3470 · 3 reaction ·
Tất cả issue của PowerShell/PSReadLine
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
azurenoops/spin_agent#975 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SubtitleEdit/subtitleedit#15108 · 1 bình luận ·