Skip to content

PowerShell does not set the terminal window title when opened via directory context menu #8163

@ghost

Description

Steps to reproduce

  1. Install PowerShell Core 6.1 on Windows
  2. Agree to add directory context menu during the installation
  3. Right-click any directory, select menu item: "PowerShell 6" -> "Open here"
  4. Start PowerShell from the start menu: click Start button, select "PowerShell 6 (x64)" menu item.

Expected behavior

The titles of both PowerShell windows should match.

Actual behavior

The window opened via Start button has the title: "PowerShell 6 (x64)"
The window opened via directory context menu has the title: "C:\Program Files\PowerShell\6\pwsh.exe"

Workaround

Open regedit.exe and fix the following keys:

  • HKEY_CLASSES_ROOT\Directory\ContextMenus\PowerShell6x64\shell\open\command
  • HKEY_CLASSES_ROOT\Directory\ContextMenus\PowerShell6x64\shell\runas\command

In the (Default) entry append the following to the value: -Command "$host.UI.RawUI.WindowTitle = 'PowerShell 6 (x64)'"

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Microsoft Windows 10.0.17134
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

Area-Maintainers-Buildspecific to affecting the buildIssue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions