Home > Blockchain >  Is there a way to specify task icon and color when running the "nx run" command?
Is there a way to specify task icon and color when running the "nx run" command?

Time:11-22

I found the functionality to manually assign an icon and a color to a specific task in Visual Studio Code after I start it on the "nx console" sidebar with the "play icon" button. Can you somehow assign the icon and color you want to see to the nx command itself, so you don't have to set it up manually every time by right clicking the task?

This is what I see when I click on "serve":

icon and color not specified

This is what I want to see after clicking on "serve":

icon and color specified

Note: I moved both panels to one corner so they are next to each other

CodePudding user response:

You have to have a tasks.json configured for the project. You probably already have one, but if you don't, the file goes under .vscode/. The bit that controls the appearance of this icon is this:

{
  // ...
  "tasks": [
    {
      // ...
      "icon": {
        "id": "database",
        "color": "terminal.ansiGreen"
      }
    }
  ]
}

You can use autocomplete to explore the available colours and icons.

  • Related