question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: add 'Terminal' to $PSVersionTable to make support requests easier.

See original GitHub issue

Summary of the new feature/enhancement

The powershell team will likely get an increase in bug reports from people running Windows Terminal, or want to see if some behavior is specific to Windows Terminal or the old terminal (which I guess is called ‘console’?). You might want to add the Terminal as a field to $PSVersionTable:

 $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.5
PSEdition                      Core
GitCommitId                    7.0.0-preview.5
OS                             Microsoft Windows 10.0.18908
Platform                       Win32NT
Terminal                       Windows Terminal (Preview) 0.6.2951.0
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
daxian-dbwcommented, Nov 6, 2019

The PSReadLine bug report template provides the following script to help an issue author to collect environment data about whether you are running in Windows terminal:

    $hostName = $Host.Name
    if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
        $id = $PID
        $inWindowsTerminal = $false
        while ($true) {
            $p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
            if (!$p -or !$p.Name) { break }
            if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
            $id = $p.ParentProcessId
        }
        if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
    }

   "HostName: $hostName"

0reactions
iSazonovcommented, Nov 6, 2019

@lzybkr @daxian-dbw Based on your PSReadline experience can you reword the request so that we could understand what useful would we add to $PSTableVersion about current terminal/console?

Read more comments on GitHub >

github_iconTop Results From Across the Web

PowerShell for the Mac Admin - Part 3: Do You Want To ...
There are many ways to install and keep PowerShell updated: it has its own built-in update feature; you can update it through Homebrew;...
Read more >
Getting Started with PowerShell Core on Windows, Mac ...
To get started with PowerShell Core you want to install and ... From Mac or Linux simply open the terminal window and type...
Read more >
Visual Studio Code - powershell.integratedConsole. ...
I have to remember to manually move the focus to the terminal when the script requests user input (e.g., Read-Host), or else my...
Read more >
Contribution guidance | PnP PowerShell
This guidance should help you getting started contributing to PnP PowerShell by just following some easy steps. There are various ways to accomplish...
Read more >
Feature requests that are not implemented and how these ...
I have a question which I can't seem to find the answer to online. I am trying to understand more about how the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found