open-cli-tools / concurrently

Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
https://www.npmjs.com/package/concurrently
MIT License
7.01k stars 228 forks source link

Prefix padding #495

Closed gustavohenke closed 1 month ago

gustavohenke commented 1 month ago

Added a --pad-prefix flag which makes all prefixes the same length, padding shorter ones with spaces.

Example:

$ concurrently -n foo,barbaz --pad-prefix "echo foo" "echo bar"
[foo   ] foo
[foo   ] echo foo exited with code 0
[barbaz] bar
[barbaz] echo bar exited with code 0

Noteworthy: Although most prefixes have a stable length, PIDs can become longer if the command restarts, e.g. it was originally 9 but after a restart it's 10. Obviously we can't rewrite the past, so new log entries from that respawn onwards will be padded appropriately.

Closes #166 Closes #417

coveralls commented 1 month ago

Coverage Status

coverage: 99.177% (+0.03%) from 99.144% when pulling 126b571e7a43a864430550193bb1798369479032 on prefix-padding into 23f97ac412f390a9913f96814da1f4070704d955 on main.