31

My vscode project has an "app" folder which is the root folder for my workspace.

It is possible to change the title of this workspace?

workspaces

kolypto
  • 27,502
  • 15
  • 92
  • 90

4 Answers4

31

Use the "File -> Save Workspace As ..." to save it into a file.

Menu

Normally, you would only want to use a <name>.code-workspace file with multi-root projects (that is, projects that include multiple folders), but this is also the only way to rename a workspace.

More information:

P.S. All the credit goes to Henry for pointing me to .code-workspace files :) Thanks!

kolypto
  • 27,502
  • 15
  • 92
  • 90
  • 1
    This doesn't really rename the workspace, it just duplicates the workspace file under a new name. So, you still have the old workspace file that you'll then have to delete manually. – Gabriel Staples Oct 14 '21 at 19:29
10

I haven't yet found a way to change the name of the workspace itself (without changing the filename); but one thing not mentioned in other answers that might be relevant: you can edit the .code-workspace file and add a name property to set a custom display name for each folder in your workspace:

{   
  "folders": [
    {
      "path": "../path/to/folder",
      "name": "my custom folder name"
    }
  ],
  "settings": {}
}
blindfish
  • 675
  • 8
  • 9
9

Simply edit the .code-workspace file contained in the actual folder (via file explorer) and rename it. That's it!

Henry
  • 91
  • 5
  • You should probably go to **File --> Close Workspace** first, and _then_ use your file explorer to rename the workspace file, and then re-open the workspace. – Gabriel Staples Oct 14 '21 at 19:28
  • @GabrielStaples If you save the .code-workspace file, the Visual Studio Code UI updates pretty much immediately, even if it's open. I think it's designed such that there's no need to close the workspace first. – Grant Apr 17 '22 at 01:24
2

How to rename a VSCode workspace:

  1. File --> Close Workspace.

    enter image description here

  2. Manually rename the workspace file in your operating system's file explorer or terminal. Ex: on Linux or Mac or in the git bash terminal using Git For Windows:

    cd path/to/workspace
    mv old_workspace_name.code-workspace new_workspace_name.code-workspace
    
  3. File --> Open Workspace from File..., then select the workspace you just renamed.

    enter image description here

See Also:

  1. The other answers here.
  2. Official VSCode documentation: https://code.visualstudio.com/docs/editor/multi-root-workspaces#_save-workspace-as
Gabriel Staples
  • 22,024
  • 5
  • 133
  • 166