nx-console icon indicating copy to clipboard operation
nx-console copied to clipboard

Would be nice to see terminal tasks in VS Code without "nx run " prefix

Open AdditionAddict opened this issue 2 years ago • 10 comments
trafficstars

Description

Currently all tasks started in nx console are prefixed by nx run in the terminal pane to can be hard to distinguish my-app and my-app-api. It'd be nice the have the names just be of the form <project>:<task>

Terminal pane

Motivation

Easier switching between terminal windows

Suggested Implementation

name property on creationOptions https://code.visualstudio.com/api/references/vscode-api#Terminal

Alternate Implementations

AdditionAddict avatar Aug 03 '23 10:08 AdditionAddict

it's not a bad idea :) maybe we could even add the Nx icon to make it easy to spot without the nx run.

Since you've already found the right spot to control the behaviour, would you be interested in contributing this?

MaxKless avatar Aug 03 '23 11:08 MaxKless

@MaxKless sure, I'll dig in

AdditionAddict avatar Aug 03 '23 15:08 AdditionAddict

Awesome that's great to hear. If you need any help or pointers feel free to ping me here or on twitter :)

Appreciate it

MaxKless avatar Aug 04 '23 08:08 MaxKless

if I can help with anything @AdditionAddict let me know :)

MaxKless avatar Aug 21 '23 13:08 MaxKless

@AdditionAddict Have you made any progress on this?

mkapal avatar May 30 '24 04:05 mkapal

I don't think this is happening, the issue has been lying around for a bit. If you want to take over, @mkapal I'd be glad to help out. This should be a good issue to get to know the codebase a bit more easily.

MaxKless avatar Jun 05 '24 10:06 MaxKless

OK, I'm having a look.

Besides nx run, there can be other commands running like nx run-many or nx affected:

image

How should these cases be handled? I like the idea of having the Nx icon next to the command name so we can get rid of the nx prefix for all Nx tasks. For nx run tasks, maybe there could be a "run" icon so the task names can be without nx run? Or do you have other thoughts?

mkapal avatar Jun 06 '24 12:06 mkapal

I'm thinking if we have an nx icon, just saying server:serve would be enough honestly. From your examples I would do this:

  • server:serve
  • client:serve
  • run-many --target=test --watch
  • affected --target=test --watch

The full command will still be visible at the top if people want to see it

MaxKless avatar Jun 06 '24 13:06 MaxKless

OK, I will try.

By the way, what's the difference between the CliTask and NxTask class? Their implementation looks very similar.

mkapal avatar Jun 06 '24 15:06 mkapal

honestly, I'm not sure. I think it has to do with vscode's task api but I don't recall the details right now

MaxKless avatar Jun 06 '24 16:06 MaxKless