$psEditor does not handle 32/64 bit file redirection
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
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp, powershell, vscode
- Lĩnh vực
- devtools, operating-systems
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi entry point $psEditor.Workspace.OpenFile và cách nó truyền các đường dẫn Windows tới VSCode. Tái hiện việc chuyển hướng 32/64-bit bằng ví dụ profile-path được cung cấp, sau đó so sánh với workaround sysnative. Hoàn thành khi một đường dẫn 64-bit hợp lệ được mở mà không âm thầm trỏ tới đường dẫn sysWOW64 không tồn tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 767
- Fork
- 266
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 1
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/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Đang mở
PowerShell/PowerShellEditorServices#2331 · 1 reaction · 2 người được giao ·
-
Area-Language Server Issue-Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PowerShell/PowerShellEditorServices#2315 · 1 bình luận ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 reaction · 2 người được giao ·
-
Issue-Bug Needs: Triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PowerShell/PowerShellEditorServices#2293 · 1 bình luận ·
-
PowerShell/PowerShellEditorServices#2282 · 1 bình luận · 1 reaction · 2 người được giao ·
Tất cả issue của PowerShell/PowerShellEditorServices
Issue tương tự
-
Độ 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 ·
-
area/docs-content Bug pulumi/docs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 94/100
-
agentic-workflows untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100