concurrently icon indicating copy to clipboard operation
concurrently copied to clipboard

Feature request: option to disable console clearing

Open emillaine opened this issue 4 years ago • 3 comments

Some commands such as CRA's "start" script clear the console (see facebook/create-react-app#2495), causing the previous output of the other commands to disappear when used with concurrently.

Would it be possible to add a command-line option to concurrently to disable the console clearing for all the child commands?

emillaine avatar Jan 26 '21 14:01 emillaine

My issue was "tsc -w" clearing the console and that was fixed in https://github.com/Microsoft/TypeScript/issues/21295. In this ticket there are also some workarounds that might help, like dropping the control character that clears the screen using sed or awk.

priegger avatar Jan 29 '21 13:01 priegger

maybe we can mess with the "tty detection" of the programs usually clearing is disabled when stdout goes to a pipe, at least in the linux world ^^

milahu avatar May 08 '21 06:05 milahu

Hi, after some investigations (I had the exact same problem with tsc -w), I feel like there's just the need to catch the character \x1Bc.

In the TypeScript compiler, we got the following line:

const clearScreen = () => {
  process.stdout.write("\x1Bc");
}

For sanity of concurrently, I think it would be better to have the non-clearing option opt-in, and letting the user disabling it if he wants. Otherwise it's really weird, you can pretty easily get some other messages cleared by your compiler, etc. (Which is my case for info, my frontend messages are cleaned by the TS compiler, and I couldn't see them properly.)

I can take a look and make a PR if that seems a good idea

ghivert avatar Nov 14 '22 13:11 ghivert