Skip to content

Feature request: Prefix output with (colored?) indicator of which process it came from #46

Closed

Description

@ksmithbaylor

After having used docker-compose in the past, I really liked the way it showed output from all of the processes it runs. Here's a screenshot:

Docker-compose screenshot

It would be nice if parallelshell allowed me to specify a "name" for each process and automatically choose a different color for each prefix. If a name was not given, it would fall back to using the name of the command that was run.

The npm package "concurrently" offers something similar, but the prefixes are not colored and the package itself does not handle colored output well in general.

I'd be happy to work on a pull request if this is something that would be useful!

Activity

  1. paulpflug commented on Feb 16, 2016

    @paulpflug
    Collaborator

    currently the color of the child processes are passed through
    to color the output within parallelshell, we would need to buffer it, but then the color information of the children would get lost.

    There could be a flag to switch between the both modes, but what really bothers me is how you want to pass the information which process gets which color ?

  2. self-assigned this
    on Oct 18, 2017
  3. darkguy2008 commented on Oct 1, 2026

    @darkguy2008
    Owner

    Hey! This is now in 4.0.0 🎉 Use -p (or --prefix) to label every line with its command, or put -l name before a command to name it:

    parallelshell -l api "node server.js" -l web "npm run watch"
    

    npm scripts get their script name as the label and labels are colored like docker compose when the output is a terminal. Commands also get FORCE_COLOR so their own colors stay on. It took a while but thanks for the idea! Feel free to reopen if something looks off 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions