Show the current directory in the Visual Studio Developer Powershell terminal window #17722

Open
opened 2026-01-31 05:51:25 +00:00 by claunia · 0 comments
Owner

Originally created by @MrYossu on GitHub (Jun 15, 2022).

When I right-click a project in the Visual Studio Solution Explorer, and choose "Open in Terminal", I get the Powershell window open. However, the title of this window seems to be fixed at "Developer Powershell", and does not seem to be updated the way a regular Powershell window's title is.

My Powershell profile contains the following...

function Prompt {
    $host.UI.RawUI.WindowTitle = Get-Location
    Write-Host ("" + $(get-location) +">") -nonewline -foregroundcolor Yellow
    return " "
}

When in a regular Powershell window (ie not opened from within VS), my command prompt is set correctly, and the window title shows the current directory. However, in the VS Developer Powershell terminal window, whilst the command prompt is set, the title never changes.

I would like the VS Developer Powershell terminal window to change its title to show the current directory (or whatever else I choose in my profile).

Note that whilst this is useful in a regular Powershell window, it's not vital, as you're not usually more than a few lines from a command prompt, so you can easily see the current directory. However, when using the terminal in VS, dotnet watch run produces a lot of output, and your last command prompt quickly scrolls away to the far distance, leaving you with a LOT of scrolling to check which directory you're in. When working with multiple terminals (for multiple projects in a solution), this makes it very difficult to keep track of which terminal window is for which project.

Originally created by @MrYossu on GitHub (Jun 15, 2022). When I right-click a project in the Visual Studio Solution Explorer, and choose "Open in Terminal", I get the Powershell window open. However, the title of this window seems to be fixed at "Developer Powershell", and does not seem to be updated the way a regular Powershell window's title is. My Powershell profile contains the following... ``` function Prompt { $host.UI.RawUI.WindowTitle = Get-Location Write-Host ("" + $(get-location) +">") -nonewline -foregroundcolor Yellow return " " } ``` When in a regular Powershell window (ie not opened from within VS), my command prompt is set correctly, and the window title shows the current directory. However, in the VS Developer Powershell terminal window, whilst the command prompt is set, the title never changes. I would like the VS Developer Powershell terminal window to change its title to show the current directory (or whatever else I choose in my profile). Note that whilst this is useful in a regular Powershell window, it's not vital, as you're not usually more than a few lines from a command prompt, so you can easily see the current directory. However, when using the terminal in VS, `dotnet watch run` produces a lot of output, and your last command prompt quickly scrolls away to the far distance, leaving you with a **LOT** of scrolling to check which directory you're in. When working with multiple terminals (for multiple projects in a solution), this makes it very difficult to keep track of which terminal window is for which project.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17722