Gangadhar Jannu
Gangadhar Jannu

Reputation: 4414

Change Integrated Terminal title in vscode

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:

Integrated terminal 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

Answers (5)

diarcastro
diarcastro

Reputation: 876

To open the command palette in VS Code:

Windows

Press the following key combination: Ctrl + Shift + P

MAC

Press cmd + shift + p

In the command palette, type the follwing:

Terminal: Rename

Then you can change the terminal name/title

Upvotes: 86

VonC
VonC

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

Mark
Mark

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 and terminal.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

Mark
Mark

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

Apit John Ismail
Apit John Ismail

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.

enter image description here

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

Related Questions