Skip to content

Commit ceb1ca5

Browse files
authored
Update the script in issue template to find out if powershell runs in Windows Terminal (#1085)
1 parent 288e3c0 commit ceb1ca5

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,32 @@ Before submitting your bug report, please check for duplicates, and +1 the dupli
44
There are a few common issues that are commonly reported.
55
66
If there is an exception copying to/from the clipboard, it's probably the same as https://github.com/PowerShell/PSReadLine/issues/265
7-
87
If there is an exception shortly after resizing the console, it's probably the same as https://github.com/PowerShell/PSReadLine/issues/292
98
-->
109

1110
Environment data
1211
----------------
1312

14-
<!-- provide the output of the following:
15-
```powershell
13+
<!--
14+
15+
The following script will generate the environment data that helps triage and investigate the issue.
16+
Please run the script in the PowerShell session where you ran into the issue and provide the output here.
17+
1618
& {
17-
"PS version: $($PSVersionTable.PSVersion)"
19+
$hostName = $Host.Name
20+
if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
21+
$id = $PID
22+
$inWindowsTerminal = $false
23+
while ($true) {
24+
$p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
25+
if (!$p -or !$p.Name) { break }
26+
if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
27+
$id = $p.ParentProcessId
28+
}
29+
if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
30+
}
31+
32+
"`nPS version: $($PSVersionTable.PSVersion)"
1833
$v = (Get-Module PSReadline).Version
1934
$m = Get-Content "$(Split-Path -Parent (Get-Module PSReadLine).Path)\PSReadLine.psd1" | Select-String "Prerelease = '(.*)'"
2035
if ($m) {
@@ -27,10 +42,11 @@ Environment data
2742
"os: $((dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion)"
2843
}
2944
"PS file version: $($name = if ($PSVersionTable.PSEdition -eq "Core") { "pwsh.dll" } else { "powershell.exe" }; (dir $pshome\$name).VersionInfo.FileVersion)"
45+
"HostName: $hostName"
3046
"BufferWidth: $([console]::BufferWidth)"
31-
"BufferHeight: $([console]::BufferHeight)"
47+
"BufferHeight: $([console]::BufferHeight)`n"
3248
}
33-
```
49+
3450
-->
3551

3652
Steps to reproduce or exception report

0 commit comments

Comments
 (0)