Skip to content
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

Closed

Conversation

k0pernikus
Copy link

@k0pernikus k0pernikus commented Aug 12, 2017

Here'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

* added optional clearScreen method to System]
* implemented via `x1Bc`, reset screen
* fixes 13020
@mhegazy
Copy link
Contributor

mhegazy commented Sep 7, 2017

this does not seem to be clearing the screen for me on Windows. is this expected?

@k0pernikus
Copy link
Author

@mhegazy Yes, it is. @RyanCavanaugh pointed out that they will take care of the windows implementation.

@k0pernikus
Copy link
Author

Furthermore, I am not sure if the \x1Bc is the best choice for unix / linux system as well. It's the one I found working for me in my Gnu/Linux system inside the Bash.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 8, 2017

Yes, it is. @RyanCavanaugh pointed out that they will take care of the windows implementation.

i am not talking about tsc.exe. that one does not support --watch anyways. i am talking about node tsc.js on a windows cmd.
@RyanCavanaugh any comments?

@microsoft microsoft deleted a comment from msftclas Sep 26, 2017
@microsoft microsoft deleted a comment from msftclas Sep 26, 2017
@k0pernikus
Copy link
Author

@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()) {
Copy link
Contributor

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.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 8, 2017

@k0pernikus mind refreshing the PR.. also you will need to remove reporting of File_change_detected_Starting_incremental_compilation since it is useless now that we are always clearing the screen.

@k0pernikus
Copy link
Author

@mhegazy Thanks for the feedback. I will have a look into it!

@mhegazy
Copy link
Contributor

mhegazy commented Dec 2, 2017

Superseded by #20389

@mhegazy mhegazy closed this Dec 2, 2017
JoshuaKGoldberg pushed a commit to JoshuaKGoldberg/TypeScript that referenced this pull request Dec 3, 2017
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.
@hoegge
Copy link

hoegge commented May 2, 2018

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:

tsc -wc if it should clear console (like flushing the toilet before compiling your s... again ;-) )

tsc -w to work as "normal"

@k0pernikus
Copy link
Author

@hoegge typescript has the --preserveWatchOutput flag for watch:

tsc -w --preserveWatchOutput

@hoegge
Copy link

hoegge commented May 2, 2018

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).

@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tsc -w should clear screen before each run
5 participants