concurrently icon indicating copy to clipboard operation
concurrently copied to clipboard

Filter for output of specific commands

Open reknih opened this issue 2 years ago • 7 comments

Description: Allow me to filter which command outputs I want to display. Still run all tasks.

Use case: I want to debug a particular task of the set of tasks I run with concurrently and focus on its outputs. At the moment, I solve this by calling npm run dev | grep name-of-task. This works but potentially includes false positives. Additionally, concurrently will not color the task name because it is not directly attached to the terminal.

reknih avatar Jul 12 '23 07:07 reknih

How does the existing --hide flag work for you?

gustavohenke avatar Jul 15 '23 02:07 gustavohenke

I have a similar situation. I have two processes and would like to use --hide 1 --raw, so that only the output from the first process is displayed. Unfortunately, --raw seems to ignore any --hide argument.

Would it make sense to support this?

amannn avatar Aug 04 '23 10:08 amannn

Yes, but note that raw mode implies inheriting stdio, which means no control over the output.

https://github.com/open-cli-tools/concurrently/blob/a61ef39468c82b66ebb247a5a5e2cf479a0c4def/src/get-spawn-opts.ts#L42

It might be possible to change it to ignore instead of inherit to support your use case.

gustavohenke avatar Oct 02 '23 08:10 gustavohenke

How does the existing --hide flag work for you?

It works I guess but I run many tasks, so it's much easier to list the task I want to see instead of every other task.

reknih avatar Oct 02 '23 10:10 reknih

Thumbs up for --hide 1 --raw . Did anyone manage to get this working (with colors)?

Update: Found a surprisingly simple solution:

concurrently \"command-1\" \"command-2 > /dev/null 2>&1\" --raw

wottpal avatar Aug 24 '24 08:08 wottpal

Hey @wottpal and @amannn, the --hide + --raw flag combo has been fixed by #486. It's not yet released.

gustavohenke avatar Aug 25 '24 22:08 gustavohenke

☝️ It's been released now. https://github.com/open-cli-tools/concurrently/releases/tag/v9.0.0

gustavohenke avatar Sep 08 '24 13:09 gustavohenke