Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

showing project folder in title bar for Visual Studio Code

Is it possible to show the last folder in the title bar? If you have multiple instances of VS Code open, it is difficult to distinguish between them from the task bar. If both instances are open on say a file called 'main.ts', you will see 'main.ts' in the taskbar item.

Currently, the title would be [filename open] - [folder open] (e.g main.ts - angular2-training. Is it possible to invert them to become [folder open] - [filename open] (e.g angular2-training - main.ts?

like image 230
Karl Cassar Avatar asked Jul 20 '16 14:07

Karl Cassar


People also ask

How do you show title bar in VS Code?

VS Code Window Title Bar Setting In File → Preference → Settings → Window → Title Bar Style , change it from native to custom .

Where is project in VS Code?

If the Visual Studio development environment is already open, you can create a new project by choosing File > New > Project on the menu bar. You can also select the New Project button on the toolbar, or press Ctrl+Shift+N.


2 Answers

Use window.title in user/workspace settings

The documentation is here with the full list of options of what can be shown. It's quite flexible.

In your case, to display angular2-training - main.ts you can use this

{   "window.title": "${rootName}${separator}${activeEditorShort}" } 

Older VS Code versions

The above only works in v1.10 and up. Here's how to do it in older versions:

v1.9, v1.8 - "window.showFullPath": true shows the full path to the current file, so you can at least see the project folder. Note this config is unsupported after v1.10

v1.7 and below - it's not possible

like image 72
davnicwil Avatar answered Sep 21 '22 09:09

davnicwil


On version 1.13

Go to settings, inside UserSettings add this line to the json blob:

"window.title": "${activeEditorLong}"

On version 1.41.1

enter image description here

like image 44
Peiti Li Avatar answered Sep 20 '22 09:09

Peiti Li