-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tsc --watch should clear screen on new compilation #17756
Conversation
* added optional clearScreen method to System] * implemented via `x1Bc`, reset screen * fixes 13020
this does not seem to be clearing the screen for me on Windows. is this expected? |
@mhegazy Yes, it is. @RyanCavanaugh pointed out that they will take care of the windows implementation. |
Furthermore, I am not sure if the |
i am not talking about tsc.exe. that one does not support |
@RyanCavanaugh Could you please provide feedback for my PR, and when I can expect this to be merged? |
@@ -402,6 +406,9 @@ namespace ts { | |||
} | |||
|
|||
function recompile() { | |||
if (sys.clearScreen()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know why it was not working.. this should be if (sys.clearScreen)
instead.
@k0pernikus mind refreshing the PR.. also you will need to remove reporting of |
@mhegazy Thanks for the feedback. I will have a look into it! |
Superseded by #20389 |
I advocated against immediately clearing the console when starting --watch in microsoft#17756 because it was confusing to have the console suddenly become blank, wait a while, and _then_ give output. After using the feature for a little while, I think it's a little disorienting how the console will only start clearing after the first recompile. This change clears the console and immediately prints a new "Starting compilation in watch mode..." message.
This "feature" is really quite annoying and I don't understand how it could get implemented. That TSC clears a console showing output from several producers is intrusive and makes debugging harder. At least it should be an option only for those who for some reason wants to clear a logging console - does not make any sense at all. Before you could scroll back in your console for a server to see the history, but now TSC brutally erases all output. This is in my mind really overstepping boundaries of a command line program, to clear everything from the console and remove important output from other parts of the system. Suggestion:
|
@hoegge typescript has the
|
Hi @k0pernikus . Yes I know, but I think clearing the screen is a rare wish, and by implementing it this way, it breaks all the console output for everyone else and they / we have to modify a lot of scripts, and packages that use tsc -w to prevent it from doing that (by adding the --preserveWatchOutput). |
x1Bc
, reset screenHere's a checklist you might find useful.
[x] There is an associated issue that is labelled
'Bug' or 'Accepting PRs' or is in the Community milestone
[x] Code is up-to-date with the
master
branch[x] You've successfully run
jake runtests
locally[ ] You've signed the CLA
[ ] There are new or updated unit tests validating the change