PowerShell Tab Title in Windows Terminal

October 31st 2025 PowerShell

I often have several tabs open in my Windows Terminal. And I like how I can easily identify the right one by its title if it's a tab for WSL or an SSH connection.

Windows Terminal tab title for WSL and SSH

Only PowerShell tabs have "PowerShell" as their fixed title by default. Sure, Windows Terminal allows me to rename tabs, but I often don't bother to do it, especially since the title can easily become inaccurate.

Rename tab title in Windows Terminal

Fortunately, PowerShell can also auto-update the tab title, it's just not configured to do so by default. And Oh My Posh, which I am using, has even better support for that. Again not enabled by default, at least not in the theme I chose.

To enable it, only a single line has to be added to your configuration file. If you don't know where that file is located, check your PowerShell $PROFILE file:

code $PROFILE

Inside it, there should be a call to oh-my-posh init pwsh, similar to the following:

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\negligible.omp.json" | Invoke-Expression

The configuration file is passed as the value of the --config argument. If the file is located in $env:POSH_THEMES_PATH or only a name of the theme is used without the extension (e.g. --config negligible), you're still using one of the provided themes without any modifications. In that case, you should copy it from $env:POSH_THEMES_PATH to somewhere else, e.g., your home directory, before modifying it:

cp $env:POSH_THEMES_PATH/negligible.omp.json ~/my.negligible.omp.json

If you do that, don't forget to modify the oh-my-posh init pwsh call in your $PROFILE file to point to the file in the new location, e.g.:

oh-my-posh init pwsh --config "~\my.negligible.omp.json" | Invoke-Expression

Now you're ready to modify your configuration file, i.e., set a value for console_title_template to how you want your title to be set. The following would set it to your current directory:

{
  "console_title_template": "{{.PWD}}"
}

And make it look like this:

Custom Windows Terminal tab title for PowerShell

The setting value is formatted as an Oh My Posh template. You can learn about them in the documentation, or simply choose one of the common examples for tab title.

The setting will go into effect, when you open a new PowerShell tab or reload the profile in an already opened tab:

. $PROFILE

If you're a regular user of Windows Terminal or PowerShell in general as I am, you won't regret taking the time to configure auto updates for tab title. It doesn't take a lot of effort and it makes it much more convenient to switch between multiple tabs because you can immediately recognize the one you're looking for just by reading its title.

Get notified when a new blog post is published (usually every Friday):

Copyright
Creative Commons License