This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
By default, the tab title is set to the shell's title. If a tab is composed of multiple panes, the tab's title is set to that of the currently focused pane. If you want to customize what is set as the tab title, follow this tutorial.
In this tutorial, you learn how to:
tabTitle settingsuppressApplicationTitle settingtabTitle settingThetabTitle setting allows you to define the starting title for a new instance of a shell. If it is not set, the profilename is used instead. Each shell responds to this setting differently.
| Shell | Behavior |
|---|---|
| PowerShell | The title is set. |
| Command Prompt | The title is set. If a command is running, it is temporarily appended to the end of the title. |
| Ubuntu | The title is ignored, and instead set touser@machine:path |
| Debian | The title is set. |
Note
Though Ubuntu and Debian both run bash, they have different behaviors. This is to show that different distributions may have different behaviors.
A shell has full control over its own title. However, each shell sets its title differently.
| Shell | Command |
|---|---|
| PowerShell | $Host.UI.RawUI.WindowTitle = "New Title" |
| Command Prompt | TITLE New Title |
| bash* | echo -ne "\033]0;New Title\a" |
Note that some Linux distributions (e.g. Ubuntu) set their title automatically as you interact with the shell. If the above command doesn't work, run the following command:
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ 'echo -ne '\033]0;New Title\a'This will change the title to 'New Title'.
For easier access add this to the end of your~/.bashrc:
settitle () { export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' echo -ne '\033]0;'"$1"'\a'}After you reopen your shell, you now can change the shell's title at any time using the following command:
settitle 'New Title'suppressApplicationTitle settingSince a shell has control over its title, it may choose to overwrite the tab title at any time. For example, theposh-git module for PowerShell adds information about your Git repository to the title.
Windows Terminal allows you to suppress changes to the title by settingsuppressApplicationTitle totrue in your profile. This makes new instances of the profile set your visible title totabTitle. IftabTitle is not set, the visible title is set to the profile'sname.
Note that this decouples the shell's title from the visible title presented on the tab. If you read the shell's variable where the title is set, it may differ from the tab's title.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?