$psEditor does not handle 32/64 bit file redirection
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- csharp, powershell, vscode
- Domínio
- devtools, operating-systems
Direção de pesquisa
Comece rastreando o ponto de entrada $psEditor.Workspace.OpenFile e como ele passa os caminhos do Windows para o VSCode. Reproduza o redirecionamento de 32/64-bit usando o exemplo de profile-path fornecido e, em seguida, compare-o com o workaround sysnative. Está concluído quando um caminho 64-bit válido é aberto sem direcionar silenciosamente para o caminho sysWOW64 inexistente.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- C#
- Estrelas
- 767
- Forks
- 266
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 1
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Aberta
PowerShell/PowerShellEditorServices#2331 · 1 reação · 2 responsáveis ·
-
Area-Language Server Issue-Enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
PowerShell/PowerShellEditorServices#2315 · 1 comentário ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 reação · 2 responsáveis ·
-
Issue-Bug Needs: Triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
PowerShell/PowerShellEditorServices#2293 · 1 comentário ·
-
PowerShell/PowerShellEditorServices#2282 · 1 comentário · 1 reação · 2 responsáveis ·
Todas as issues de PowerShell/PowerShellEditorServices
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
SubtitleEdit/subtitleedit#15108 · 1 comentário ·
-
area/docs-content Bug pulumi/docs
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 94/100
-
agentic-workflows untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100