155

Visual Studio Code's default status bar color is blue, and I find it quite distracting. I used this extension to change the color, but it has stopped working after the 1.10.2 update.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shahzaib Rahim
  • 1,717
  • 2
  • 9
  • 17
  • For people recently had same question, check a humble try of my own on the default theme colors change + integrating Material Icon theme installation https://github.com/mostafero/vscode-ubuntu-theme – Mostav Dec 14 '20 at 19:28
  • 1
    Personally, I didn't even want to customize it, I just wanted to find out the _meaning_ of the colors. Other than the API reference, the only place they seem to document that purple is the "no folder" color is [a "Note:" box in the Debugging section](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations), long _after_ which they also mention in passing that orange means debugging. But it's never presented in one place, or given a finite number of states (3). Feels like info that could live somewhere [HERE](https://code.visualstudio.com/docs/getstarted/userinterface). – FeRD Jan 18 '22 at 13:50
  • For how to turn off a change in status bar color when debugging, see https://stackoverflow.com/a/74779671/836330. Set `debug.enableStatusBarColor` to `false`. – Mark Dec 29 '22 at 17:18

11 Answers11

287

You can change the colour of the statusbar by editing the user settings by adding these lines of code in it:

"workbench.colorCustomizations": {
    "statusBar.background" : "#1A1A1A",
    "statusBar.noFolderBackground" : "#212121",
    "statusBar.debuggingBackground": "#263238"
}
Gama11
  • 31,714
  • 9
  • 78
  • 100
acesmndr
  • 8,137
  • 3
  • 23
  • 28
  • can this be done dynamically? `const config2 = vscode.workspace.getConfiguration('workbench.colorCustomizations.statusBar');` `config2.update('background', '#1A1A1A');` doesn't seem to do anything? – Tom Jan 02 '18 at 08:52
  • @TomH I'm no expert and not quite sure how it's done "dynamically" but running `Object.assign(vscode.workspace.getConfiguration('workbench.colorCustomizations'), { "statusBar.background" : "#00FF00"})` is giving me a TypeError telling me that we can't assign to a read only property. So I guess using the getConfiguration method isn't the correct way to do it. – acesmndr Jan 08 '18 at 11:15
  • 3
    This works well thanks @acesmndr. As described here: https://code.visualstudio.com/docs/getstarted/themes#_customizing-a-color-theme, you can also make this change to the user settings file theme specific like this: "workbench.colorCustomizations": { "[Markdown Editor Dark]": { "statusBar.background" : "#1A1A1A", "statusBar.noFolderBackground" : "#212121", "statusBar.debuggingBackground": "#263238" } }, – Walton Oct 11 '18 at 09:42
  • 1
    really helpful answer @acesmndr – Akhila Jul 26 '20 at 19:57
  • But how do I make it automatically switch back to dark when I change the theme to dark? UPD: Never mind, I just saw shacker's answer. – tolache Aug 02 '22 at 08:02
126
  1. I am going to save 30 minutes of time to noobs like me - it has to be edited in the settings.json file. The easiest way to access it is menu command FilePreferencesSettings, search for "Color", choose an option "Workbench: Color Customizations" → "Edit in settings.json".

  2. This uses the solution proposed by Gama11, but note:
    the final form of the code in the settings.json file should be like this - note the double curly braces around "workbench.colorCustomizations":

     {
       // fontSize just for testing purposes, commented out.
       //"editor.fontSize" : 12
    
       // StatusBar color:
          "workbench.colorCustomizations": {
          "statusBar.background" : "#303030",
          "statusBar.noFolderBackground" : "#222225",
          "statusBar.debuggingBackground": "#511f1f"
         }
     }
    

After you copy/pasted code above, press Ctrl + S to save the changes to 'settings.json'.

The solution has been adapted from Status Bar colors.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
J.Paul
  • 1,393
  • 1
  • 7
  • 6
  • Thank you! Having a link to edit the settings file directly within Visual Code is a nice time saver. Also the themes are easy to change from that color search in settings as well. Visual Code is highly customizable, but getting to those settings are a bit awkward for me compared to other editors I've used. – John Suit Jun 07 '21 at 22:53
33

Since every theme is so different, you probably don't want to make changes like this globally. Instead, specify them on a per-theme basis: e.g.:

"workbench.colorCustomizations": {
    "[Some Theme Name]": {
        "statusBar.background" : "#486357",
        "statusBar.foreground" : "#c8e9c5",
    },
    "[Some Other Theme Name]": {
        "statusBar.background" : "#385357",
        "statusBar.foreground" : "#d7e9c4",
    }
},

That way when you switch between your favorite themes, your customizations of them will not be forgotten, and will make sense in that context.

shacker
  • 14,712
  • 8
  • 89
  • 89
  • 3
    It's also great to apply this to workspace settings to differentiate between different projects, when multiple VSCode instances are open. One can also change `titleBar.activeBackground` and `titleBar.activeForeground` to make it even more apparent. – Qwerty Aug 02 '19 at 12:31
  • 1
    Note that, like in the other answers, you probably also want to set `statusBar.noFolderBackground` and `statusBar.debuggingBackground`, otherwise they won't be affected. – lapis Oct 12 '19 at 09:24
11

These are the steps I took to set the Visual Studio Code status bar colors on macOS for a workspace (not globally).

Menu ViewCommand Palette... → search for "Open Workspace Settings (JSON)".

(This will open the project [project-name].code-workspace file.)

Add the color customizations in the settings property.

{
    "folders": [],
    "settings": {
        "workbench.colorCustomizations": {
            "statusBar.background": "#938e04",
            "statusBar.foreground": "#ffffff"
        }
    }
}

This is really useful when you have multiple instances of Visual Studio Code open and want to visually differentiate each window without having to change the global theme.

If you do not have a Workspace defined, Visual Studio Code will open .vscode/settings.json on command "Open Workspace Settings (JSON)".

If this is the case, you can just enter the workbench customizations directly:

{
   "workbench.colorCustomizations": {
        "statusBar.background": "#938e04",
        "statusBar.foreground": "#ffffff"
    }
}
HelloWorldDude
  • 146
  • 1
  • 4
5

There is a stronger, more robust solution than the previous answers in my opinion, and that’s to change the status bar color based on the file you're working on—it’s called ColorTabs, and it allows you to provide a list of regular expressions and change that color based on that.

Disclaimer - I wrote the extension.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
orepor
  • 905
  • 2
  • 13
  • 23
  • 1
    Nice extension - would love to have the regex work on full path so I can differentiate between all my VSCode opened projects. – cyberwombat Nov 03 '19 at 18:34
  • 1
    It actually was on full paths, but I changed it to relative paths...Maybe it can be configured – orepor Nov 04 '19 at 07:34
  • 2
    This would be nice to configure tab colours on the branch instead of the file name - if its develop -> green, qa -> orange, master -> red, others -> default? – Johan Aspeling Jan 07 '20 at 10:18
  • 1
    The guy who wrote an extention that solves the problem has less votes than other posts which repeat what the top post says, nice. – a.anev Jul 17 '20 at 20:28
3

I just registered so I can't comment directly on HelloWorldDude's reply, but that's exactly what I was looking for: Different colors per workspace to quickly differentiate between Visual Studio Code windows.

I'm on Windows 10 with Visual Studio Code 1.63.1 and the per-project setting is located in the .vscode folder of the project root, and the file itself is settings.json.

The syntax that worked for me does not include "folders" and "settings", but just the contents of the settings block, like so:

{
  "workbench.colorCustomizations": {
      "statusBar.background": "#7c0101",
      "statusBar.foreground": "#ffffff"
  }


}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
FLI
  • 31
  • 1
2

You can change the color by edit extensions:

 "colors":{
        "statusBar.background": "#505050",
    },
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
1

There is one more extension available, Peacock, to change the color of the workplace. It allows you to choose a different color for every Visual Studio Code instance.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

If you are using the Vim plugin, the best way to change status bar color depending on mode is to go to settings, search for "status bar color" and check "allow Visual Studio Code to change color based on mode"

Here is a snapshot of the Vim plugin status color control:

Snapshot

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Tarik Waleed
  • 97
  • 1
  • 8
0

Visual Studio 1.75 (Jan. 2023) will propose one more option, from issue 155294:

I am becoming a power-user of our debugger (yeah, finally).
This means that most of my "VS Code time" I have some kind of debuggee running or connected.

So, I am seeing the ugly orange debug status bar treatment a lot.
I don't like it and for me it's enough to see the activitybar icon decorations.

Instead of setting statusBar.debuggingBackground in workbench.colorCustomizations, there is now (PR 168513) a dedicated setting:

debug.enableStatusBarColor: Color status bar when debugger is active

This is available in VSCode insider today.

This is also mentioned in "How to prevent status bar colour in visual studio code from changing to orange on running any java file" by Mark.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
-1

Press Control + Shift + P when you just open Visual Studio Code and type "open settings(UI)" and search for window.titleBarStyle and change the option from native to custom so that you can restore the colour of status bar from white to black.

Important note: This technique works for update version 1.32 of Visual Studio Code released in February 2019. Make sure that you have updated your Visual Studio Code to the latest version 1.32 or further latest ones as it may not work for the older versions.

Example Screenshot

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rahul Ahire
  • 685
  • 11
  • 28