Skip to content

[Bug] MSIX/winget 版 PowerShell 7 无法被发现,本地终端默认回退 PowerShell 5.1 #3280

Description

@CNHLAIA

Operating system: Windows 11

Netcatty version: 1.1.82

How did you install Netcatty? GitHub Release (.exe)

Affected area: SSH connection / terminal, Settings

Can you reproduce it? Always (100%)

Steps to reproduce

  1. 用 winget MSIX 源安装 PowerShell 7(winget install --id Microsoft.PowerShell --source msstore):此时 pwsh 仅有执行别名 %LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exe,不存在 C:\Program Files\PowerShell\7,注册表 App Paths 也没有。
  2. 设置 → 终端 → 本地 Shell 保持"系统默认"。
  3. 首页点击"终端"。

Expected behavior

打开 PowerShell 7;本地 Shell 下拉列表出现 "PowerShell 7"。

Actual behavior

打开的是 Windows PowerShell 5.1;下拉列表无 "PowerShell 7"。

原因(v1.1.82 源码)

electron/bridges/shellDiscovery.cjsfindExecutableOnPath()electron/bridges/terminalBridge.cjsfindExecutable() 均跳过 WindowsApps 执行别名;且别名是 reparse point,fs.existsSync() 返回 false,会先被存在性检查过滤。实测 ConPTY 直接 spawn 别名完整路径可正常启动 pwsh 7.6.5,跳过别名的前提并不成立(裸名 pwsh 则会 File not found)。

临时解法

本地 Shell 选"自定义",填完整别名路径 %LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exe

相关:#2054(PR #2057 只修了标签栏快速切换入口)。

  • I searched existing issues and did not find a duplicate
  • I removed passwords, private keys, and other secrets from this report

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageTouched by Cursor automationtriage:admittedReserved for serialized automatic issue triage admissiontriage:bug-readyConfirmed Netcatty bug ready for automatic implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions