Reputation: 4414
We can open command prompt in vscode by using the Integrated Terminal
feature in View
menu.
We can even open multiple terminals as shown below:
Is there any way I can change the title of the terminal ?
I have gone through the integrated terminal documentation but I didn't find a way to do that.
Upvotes: 46
Views: 19088
Reputation: 876
To open the command palette in VS Code:
Press the following key combination: Ctrl + Shift + P
Press cmd + shift + p
In the command palette, type the follwing:
Terminal: Rename
Then you can change the terminal name/title
Upvotes: 86
Reputation: 1324757
With VSCode 1.63 (Nov. 2021), entering "<blank>
" (ie., empty string) as name will restore the default name for that terminal.
See issue 134020
For instance:
If my setting is
${cwd}${separator}${process}
and I name a terminal "foo
".
How do I reset "foo
" back to the value of${cwd}${separator}${process}
?
My suggestion was that if you attempted to submit a blank name that would automatically reset to the value of your setting.
Upvotes: 0
Reputation: 181339
In v1.61 there is the ability to set the terminal names using variables. See terminal custom titles in release notes.
Terminal names are traditonally the name of the process they're associated with. Thus, it can be difficult to distinguish between them.
We now support configuring both title and description to help with this using variables described in
terminal.integrated.tabs.title
andterminal.integrated.tabs.description
settings.The current default values are:
{
"terminal.integrated.tabs.title": "${process}",
"terminal.integrated.tabs.description": "${task}${separator}${local}${separator}${cwdFolder}"
}
Variables available are:
${cwd} - The terminal's current working directory
${cwdFolder} - The terminal's current working directory.
${workspaceFolder} - The workspace in which the terminal was launched.
${local} - Indicates a local terminal in a remote workspace.
${process} - The name of the terminal process.
${separator} - A conditional separator (" - ") that only shows when surrounded by variables with values or static text.
${sequence} - The name provided to xterm.js by the process.
${task} - Indicates this terminal is associated with a task.
It looks like the ${task}
variable is what you are looking for.
Upvotes: 15
Reputation: 181339
In v1.41 there is a new command which can be used like so:
{
"key": "ctrl+t",
"command": "workbench.action.terminal.renameWithArg",
"args": {
"name": "remote"
}
}
if you have some frequently used name, like "remote" or "build" that you use often.
Upvotes: 1
Reputation: 2145
Sometimes, plugins will remove default keyboard shortcut bindings.
Look for "terminal.rename" in keyboard shortcuts then edit the keyboard shortcut to your preferred shortcut.
To apply your shortcut, make sure your cursor is focus in edit part of the window before you key in. Not at the terminal part.
Upvotes: 3