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
6.98k stars 227 forks source link

Prefix ([0] [1]) randomly missing #467

Closed danbord closed 5 days ago

danbord commented 6 months ago

Description: I'm usign concurrently for my azure fucntions node.js project. I need to compile my typescript and run the azure functions at the same time.

here is my package.json script "start": "concurrently --kill-others \"tsc -w\" \"func start\"",

Problem is that randomly the prefix is missing from the logs. Which misalign my data in the logs which can be pretty annoying sometimes:

image

I tried to remove the prefix (since I don't really need it) but setting it to an empty string brings back the [0] and [1]. I also tried setting it to a radom caracter like "-" but still have the same issue

Expected Behavior: 1) Do not skip some prefix 2) Be able to remove the prefix by setting it to empty string

Environment Node.js v18.19

gustavohenke commented 5 months ago

Thanks for the report. I'm pretty sure that your command must be writing multiple lines without a line break at the end, e.g. process.stdout.write('hello\nworld').

How this has been a bug for so long is beyond me 🤦 https://github.com/open-cli-tools/concurrently/blame/v8.2.2/src/logger.ts#L238-L239