fix(windows): 支持 PowerShell 7.6 启动 - #332
Open
Q-xuan wants to merge 1 commit into
Open
Conversation
1. Remove-Module -ErrorAction Ignore PS 7.6 不再在 -NoProfile 下自动加载 PSReadLine, Remove-Module -Name PSReadline 会抛终止错误导致 pwsh 退出。 加 -ErrorAction Ignore 即可。 2. 更新 ConPTY 到兼容 .NET 10 / PS 7.6 的版本 旧版 ConPTY (conpty.dll 96KB / OpenConsole.exe 1121KB) 与 PS 7.6 的 .NET 10 runtime 不兼容: 调用 GetConsoleScreenBufferInfo 时 ConPTY pipe 断开, pwsh 触发 FailFast 退出 (exit code 0x80131623)。 更新到新版 (conpty.dll 112KB / OpenConsole.exe 1134KB) 修复。 相关 issue: - warpdotdev#11398 - wezterm/wezterm#7774
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了啥
zap 在 PowerShell 7.6 下直接打不开,显示「Shell 进程过早退出」。查下来是两个问题:
1. Remove-Module 报错
pwsh_init_shell.ps1第二行:PS 7.6 不再在
-NoProfile模式下自动加载 PSReadLine 了,所以这行会抛终止错误("No modules were removed"),pwsh 直接退出。修复:加
-ErrorAction Ignore2. ConPTY 版本太旧,和 PS 7.6 / .NET 10 不兼容
这是真正让 pwsh 退出的原因。zap bundle 的
conpty.dll(96KB) 和OpenConsole.exe(1121KB) 是旧版,PS 7.6 的 .NET 10 runtime 调用GetConsoleScreenBufferInfo时 ConPTY pipe 断开,pwsh 触发FailFast退出,exit code0x80131623。修复:更新到新版
conpty.dll(112KB) +OpenConsole.exe(1134KB)。Warp 官方也有同样的问题(#11398),WezTerm 已经更新修复了(wezterm#7774)。
验证
用更新后的
conpty.dll+OpenConsole.exe+Remove-Module -ErrorAction Ignore,PS 7.6.3 可以正常启动。