$psEditor does not handle 32/64 bit file redirection
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- csharp, powershell, vscode
调研方向
首先跟踪 $psEditor.Workspace.OpenFile 入口点,以及它如何将 Windows 路径传递给 VSCode。使用提供的 profile-path 示例重现 32/64-bit 重定向,然后将其与 sysnative workaround 进行比较。当有效的 64-bit 路径能够打开,且不会在无提示的情况下指向不存在的 sysWOW64 路径时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
PSES is properly running in a 64bit context, but when it passes a path to be opened in VSCode it is being redirected to the 32bit path.
Example:
Register-EditorCommand `
-Name 'PowerShellEditorServices.OpenAllUserEditorProfile' `
-DisplayName 'Open All User Editor Profile' `
-SuppressOutput `
-ScriptBlock {
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
$ProfilePath = Join-Path -Path $PShome -ChildPath 'Microsoft.VSCode_profile.ps1'
If (!(Test-Path -Path $ProfilePath)) { New-Item -Path $ProfilePath -ItemType File }
$psEditor.Workspace.OpenFile($ProfilePath)
}
The Editor Command properly creates
"C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.VSCode_profile.ps1"
Then when the same path is passed to $psEditor.Workspace.OpenFile and it is passing it to VSCode to open, Code is not handling the 32/64 redirect. This has terrible consequences for the user.
Code the attempts to open the following path:
"C:\Windows\sysWOW64\WindowsPowerShell\v1.0\Microsoft.VSCode_profile.ps1"
The command silently fails because the item does not exist.
As a temporary workaround you could pass $psEditor this path and it will work:
"C:\Windows\sysnative\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1"
This is not really a good solution and really should be addressed by VSCode. If they never plan on making a 64 bit client, they need to be handling 32/64 redirect. However, since I really don't think that will happen(or if it does, its likely not anytime soon), maybe we can get PSES handling this by passing the sysnative path if PSES is running in a 64 bit context.
- 主要语言
- C#
- 星标
- 767
- 派生
- 266
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/PowerShellEditorServices 的其他 Issue
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. 未关闭
PowerShell/PowerShellEditorServices#2331 · 1 个 reaction · 已指派 2 人 ·
-
Area-Language Server Issue-Enhancement
难度 4/5 3-5 天 新手友好度 48/100
PowerShell/PowerShellEditorServices#2315 · 1 条评论 ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 个 reaction · 已指派 2 人 ·
-
Issue-Bug Needs: Triage
难度 4/5 3-5 天 新手友好度 48/100
PowerShell/PowerShellEditorServices#2293 · 1 条评论 ·
-
PowerShell/PowerShellEditorServices#2282 · 1 条评论 · 1 个 reaction · 已指派 2 人 ·
查看 PowerShell/PowerShellEditorServices 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
难度 2/5 1-3 小时 新手友好度 72/100
azurenoops/spin_agent#975 ·
-
:watch: Not Triaged 11.0 fundamentals/subsvc
难度 2/5 1-3 小时 新手友好度 92/100
dotnet/AspNetCore.Docs#37699 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
SubtitleEdit/subtitleedit#15108 · 1 条评论 ·