Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to configure NestJs --watch mode to not clear the terminal?

Tags:

nestjs

When running a new NestJs application in --watch mode I had noticed that it clears my terminal right before logging in stdout "Starting compilation in watch mode...".

I know it is using some form of escape sequence, either \ec or \0033\0143 (essentially ESC+c) but I need so badly for that not to happen. I need the terminal not to clear.

Is there a way in any form of the NestJs configuration where I can disable this?

I'm running a concurrent process of multiple stdout and its clearing all of my processes for its own logs. within the concurrent process I've tried transforming the output to remove the escape characters. First, it feels a bit excessive to go down this approach as I should be able to stop NestJs from doing it in the first place.

like image 409
WhosDustin Avatar asked Nov 06 '25 06:11

WhosDustin


1 Answers

--preserveWatchOutput

Also you can add it to the tsconfig.json

{
  "compilerOptions": {
    "preserveWatchOutput": true
  }
}

I dug so deep on this problem only to discover my solution was merged in v.10.4.5

like image 151
WhosDustin Avatar answered Nov 08 '25 20:11

WhosDustin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!