PowerShell / PowerShell/vscode-powershell
Built-in `help` function writes Unicode BOM () to host
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.9k
- Forks
- 548
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
System Details
- Operating system name and version: Windows 10 Version 1709
- VS Code version: 1.18.0
- PowerShell extension version: 1.5.1
- Output from
$PSVersionTable:
Name Value
---- -----
PSVersion 5.1.16299.64
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.64
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
- VSCode plugin list:
C:\> code --list-extensions --show-versions
bradygaster.azuretoolsforvscode@1.3.0
CoenraadS.bracket-pair-colorizer@0.10.13
DotJoshJohnson.xml@1.9.2
eamodio.gitlens@6.1.0
EditorConfig.EditorConfig@0.11.1
johnpapa.azure-functions-tools@0.3.1
KnisterPeter.vscode-github@0.23.0
ms-mssql.mssql@1.2.1
ms-vscode.azure-account@0.2.2
ms-vscode.csharp@1.13.1
ms-vscode.PowerShell@1.5.1
msazurermtools.azurerm-vscode-tools@0.3.7
patrys.vscode-code-outline@0.0.12
PeterJausovec.vscode-docker@0.0.22
rebornix.Ruby@0.15.0
somekittens.hot-dog-stand@6.6.9
vscodevim.vim@0.10.4
zgudino.editorconfig-vscode-snippet@0.2.0
Issue Description
When I use the help function, a few garbage unicode characters are written to the output stream. Using Get-Help instead of help works as expected. This only happens in the extension-provided Powershell Integrated Console, not the default vscode console.
C:\> help get-date

NAME
Get-Date
[...snip...]
C:\> help get-date -showwindow

C:\> help get-date > $null
(no output)
C:\> get-help get-date -showwindow
(no output)
On my system, the definition of the help function is:
C:\> Get-Command help | select -ExpandProperty Definition
<#
.FORWARDHELPTARGETNAME Get-Help
.FORWARDHELPCATEGORY Cmdlet
#>
[CmdletBinding(DefaultParameterSetName='AllUsersView', HelpUri='https://go.microsoft.com/fwlink/?LinkID=113316')]
param(
[Parameter(Position=0, ValueFromPipelineByPropertyName=$true)]
[string]
${Name},
[string]
${Path},
[ValidateSet('Alias','Cmdlet','Provider','General','FAQ','Glossary','HelpFile','ScriptCommand','Function','Filter','ExternalScript','All','DefaultHelp','Workflow','DscResource','Class','Configuration')]
[string[]]
${Category},
[string[]]
${Component},
[string[]]
${Functionality},
[string[]]
${Role},
[Parameter(ParameterSetName='DetailedView', Mandatory=$true)]
[switch]
${Detailed},
[Parameter(ParameterSetName='AllUsersView')]
[switch]
${Full},
[Parameter(ParameterSetName='Examples', Mandatory=$true)]
[switch]
${Examples},
[Parameter(ParameterSetName='Parameters', Mandatory=$true)]
[string]
${Parameter},
[Parameter(ParameterSetName='Online', Mandatory=$true)]
[switch]
${Online},
[Parameter(ParameterSetName='ShowWindow', Mandatory=$true)]
[switch]
${ShowWindow})
#Set the outputencoding to Console::OutputEncoding. More.com doesn't work well with Unicode.
$outputEncoding=[System.Console]::OutputEncoding
Get-Help @PSBoundParameters | more
... and more is defined as ...
C:\> Get-Command more | select -ExpandProperty Definition
param([string[]]$paths)
$OutputEncoding = [System.Console]::OutputEncoding
if($paths) {
foreach ($file in $paths)
{
Get-Content $file | more.com
}
} else { $input | more.com }
Attached Logs
1510862054-d0c22b7a-9fe8-4400-9e12-9cb2d4fd6b5a1510862041231.zip
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Es wird keine Quelldatei und kein Test genannt. Reproduziere das Problem in der von der Erweiterung bereitgestellten PowerShell Integrated Console mit help get-date und vergleiche anschließend Get-Help mit der standardmäßigen VS Code-Konsole. Verfolge die Einstiegspunkte help und more sowie das Verhalten der Ausgabecodierung; als abgeschlossen gilt die Arbeit, wenn die BOM fehlt, während sich die normale Ausgabe, -showwindow und die Umleitung weiterhin wie berichtet verhalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell, typescript, vscode
- Bereich
- cli, developer-experience, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100