typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Console is not cleared in watch mode (also does not show the 0 error count output)

Open gitter-me opened this issue 2 weeks ago • 2 comments

Steps to reproduce

I use tsgo --watch --noEmit --skipLibCheck on Win11's Terminal with pwsh 7.5.x The console is not cleared between watched builds (there is --preserveWatchOutput which defaults to false, in other words the console should be cleared in between)

Sidenote: I also have cases where i press CTRL+S in my IDE (with an error present) in that moment the compiler watcher starts a new compilation, but does not detect the error in the file. If i change the file again, e.g. inserting a new blank line and save, now the error is picked up.

Behavior with [email protected]

tsc --watch --noEmit --skipLibCheck

clears the console and shows [08:31:19] File change detected. Starting incremental compilation...

[08:31:24] Found 0 errors. Watching for file changes.

Behavior with tsgo

tsgo --watch --noEmit --skipLibCheck

the new entries are appended in the console, without clearing (also does not show the 0 errors message)

Found 2 errors in the same file, starting at: src/sample.ts:4

build finished in 0.016s build starting at 08:37:29 AM build finished in 0.006s build starting at 08:37:31 AM build finished in 0.003s build starting at 08:37:33 AM build finished in 0.002s build starting at 08:37:35 AM build finished in 0.002s

gitter-me avatar Dec 10 '25 07:12 gitter-me

This comes down to us not using a diagnostic message in DoCycle, and so TryClearScreen does not detect the starting message and does not issue the screen clearing codes.

jakebailey avatar Dec 10 '25 18:12 jakebailey

Well, rather, I think the watch mode for non-build-mode is just not using the right messages.

jakebailey avatar Dec 10 '25 18:12 jakebailey