Folder Name as Tab Title #13273

Closed
opened 2026-01-31 03:38:21 +00:00 by claunia · 7 comments
Owner

Originally created by @tylerthrash on GitHub (Apr 1, 2021).

Please add a setting to have the tab title be the folder name. Ideally as (shell). Currently for me it just shows the shell title.

For example, if I have a PowerShell Core instance open in myApp folder then have the tab title be: "myApp (PowerShell)" or simply "myApp".

There's possibly an existing way to do this, but what I'm suggesting is to have an easy setting instead.

Originally created by @tylerthrash on GitHub (Apr 1, 2021). Please add a setting to have the tab title be the folder name. Ideally as <folder name>(shell). Currently for me it just shows the shell title. For example, if I have a PowerShell Core instance open in myApp folder then have the tab title be: "myApp (PowerShell)" or simply "myApp". There's possibly an existing way to do this, but what I'm suggesting is to have an easy setting instead.
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 03:38:21 +00:00
Author
Owner

@WSLUser commented on GitHub (Apr 1, 2021):

Please check the docs before filing issues like this: https://docs.microsoft.com/en-us/windows/terminal/tutorials/tab-title

@WSLUser commented on GitHub (Apr 1, 2021): Please check the docs before filing issues like this: https://docs.microsoft.com/en-us/windows/terminal/tutorials/tab-title
Author
Owner

@DHowett commented on GitHub (Apr 1, 2021):

Yup! This is totally possible with the cooperation of your shell.

@DHowett commented on GitHub (Apr 1, 2021): Yup! This is totally possible with the cooperation of your shell.
Author
Owner

@tylerthrash commented on GitHub (Apr 1, 2021):

I did see those docs, but I was wondering if there was an way that the tab title could be set with a simple, universal setting in Windows Terminal. This was rather a feature request. Such as having tabTitle configurations (for example, static string, absolute path, relative path), and based on the shell instance have code within Windows Terminal to do that for the most popular shells.

For anyone wondering I was able to set this up for PowerShell Core shell by adding the following code to my PowerShell Core profile in Documents\PowerShell\Microsoft.PowerShell_profile.ps1

function Prompt
{
  $host.UI.RawUI.WindowTitle = Split-Path (Get-Location) -Leaf
}
@tylerthrash commented on GitHub (Apr 1, 2021): I did see those docs, but I was wondering if there was an way that the tab title could be set with a simple, universal setting in Windows Terminal. This was rather a feature request. Such as having tabTitle configurations (for example, static string, absolute path, relative path), and based on the shell instance have code within Windows Terminal to do that for the most popular shells. For anyone wondering I was able to set this up for PowerShell Core shell by adding the following code to my PowerShell Core profile in `Documents\PowerShell\Microsoft.PowerShell_profile.ps1` ``` function Prompt { $host.UI.RawUI.WindowTitle = Split-Path (Get-Location) -Leaf } ```
Author
Owner

@DHowett commented on GitHub (Apr 1, 2021):

I'd love for us to offer this, but unfortunately it's difficult for Terminal to know what folder you're operating in. PowerShell doesn't update its process-level working directory; SSH targets a remote machine; you might have run a shell inside your shell (cmd -> wsl; which one should it report? what if you're running wmic and it changes to system32 just because?); WSL operates in a totally different filesystem environment;

The list goes on. We have a couple other things that would depend on the active working directory path that we'd love to land . . . but unfortunately we don't think we can.

@DHowett commented on GitHub (Apr 1, 2021): I'd love for us to offer this, but unfortunately it's difficult for Terminal to know what folder you're operating in. PowerShell doesn't update its process-level working directory; SSH targets a remote machine; you might have run a shell inside your shell (`cmd` -> `wsl`; which one should it report? what if you're running `wmic` and it changes to system32 _just because_?); WSL operates in a totally different filesystem environment; The list goes on. We have a couple other things that would depend on the active working directory path that we'd love to land . . . but unfortunately we don't think we can.
Author
Owner

@tylerthrash commented on GitHub (Apr 2, 2021):

That's unfortunate, but makes sense.

Maybe there could be some sort of api standards in the shell world to work with tools like Terminal better. I'm not sure if that would make sense or not, but if anyone could make that happen it would be a company like Microsoft. I guarantee Terminal is going to be hugely popular over time, so there would be leverage in that as well.

Thank you for your quick responses, and keep up the great work!

@tylerthrash commented on GitHub (Apr 2, 2021): That's unfortunate, but makes sense. Maybe there could be some sort of api standards in the shell world to work with tools like Terminal better. I'm not sure if that would make sense or not, but if anyone could make that happen it would be a company like Microsoft. I guarantee Terminal is going to be hugely popular over time, so there would be leverage in that as well. Thank you for your quick responses, and keep up the great work!
Author
Owner

@zadjii-msft commented on GitHub (Apr 2, 2021):

Maybe there could be some sort of api standards in the shell world to work with tools like Terminal better

FYI there is such a "standard", called Escape Sequences (also ANSI escape sequences, VT sequences). See this page for probably the most complete documentation. A shell can already use VT sequences to tell a terminal emulator to do all sorts of things,. For examplem, setting the title of the window with \e]0;YourTitleHere\a, which is exactly what we recommend doing 😉

@zadjii-msft commented on GitHub (Apr 2, 2021): > Maybe there could be some sort of api standards in the shell world to work with tools like Terminal better FYI there is such a "standard", called Escape Sequences (also ANSI escape sequences, VT sequences). See [this page](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands) for probably the most complete documentation. A shell can already use VT sequences to tell a terminal emulator to do all sorts of things,. For examplem, setting the title of the window with `\e]0;YourTitleHere\a`, which is [exactly what we recommend](https://docs.microsoft.com/en-us/windows/terminal/tutorials/tab-title#set-the-shells-title) doing 😉
Author
Owner

@catamphetamine commented on GitHub (Apr 29, 2021):

The list goes on.

Then it would be easier to have a page in the docs describing how to set up "Folder Name as Tab Name" for each popular shell.

No, I won't be writing something like that. I don't currently use this application.

@catamphetamine commented on GitHub (Apr 29, 2021): > The list goes on. Then it would be easier to have a page in the docs describing how to set up "Folder Name as Tab Name" for each popular shell. No, I won't be writing something like that. I don't currently use this application.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13273