-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix: preserve npm run output without trailing newline #8631
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
Conversation
…e-issue fix: preserve npm run output without trailing newline
This code doesn't fix the problem when I test it locally. $ node . run start --prefix=/Users/wraithgar/Development/scratch/run
> start
> printf 'this output will vanish'; sleep 3
~/D/n/c/b/main (gar/pr8631|✔) $ All this appears to do is delay the bug by one frame, the first resumed frame of the spinner will end up at the end of the |
- inline this.#render logic. The initial setTimeout is only used during load(), so run it there instead. - .unref() the progress bar's recurring timeout object - reuse the progress bar's timeout object with .refresh() instead of making a new one every frame - consolidate comments into one line and remove stale comments - skip clearing the line on the first frame when resuming the spinner - removed the test from $8631 as it was only testing that the very first frame of the spinner didn't clear the line, not any subsequent frames This is built off of #8631, moving the "skip clearing the line..." logic into a flag that's passed during .resume()
- inline this.#render logic. The initial setTimeout is only used during load(), so run it there instead. - .unref() the progress bar's recurring timeout object - reuse the progress bar's timeout object with .refresh() instead of making a new one every frame - consolidate comments into one line and remove stale comments - skip clearing the line on the first frame when resuming the spinner - removed the test from $8631 as it was only testing that the very first frame of the spinner didn't clear the line, not any subsequent frames This is built off of #8631, moving the "skip clearing the line..." logic into a flag that's passed during .resume()
- inline this.#render logic. The initial setTimeout is only used during load(), so run it there instead. - .unref() the progress bar's recurring timeout object - reuse the progress bar's timeout object with .refresh() instead of making a new one every frame - consolidate comments into one line and remove stale comments - skip clearing the line on the first frame when resuming the spinner - removed the test from $8631 as it was only testing that the very first frame of the spinner didn't clear the line, not any subsequent frames This is built off of #8631, moving the "skip clearing the line..." logic into a flag that's passed during .resume()
I spent quite a bit of time in the progress indicator code last night and did some cleanup. I think the "don't clear progress on resume" is still a valid thing to do so I kept it, moving it into the |
- inline this.#render logic. The initial setTimeout is only used during load(), so run it there instead. - .unref() the progress bar's recurring timeout object - reuse the progress bar's timeout object with .refresh() instead of making a new one every frame - Minor comment syntax cleanup and remove stale comments - skip clearing the line on the first frame when resuming the spinner - removed the test from #8631 as it was only testing that the very first frame of the spinner didn't clear the line, not any subsequent frames This is built off of #8631, moving the "skip clearing the line..." logic into a flag that's passed during .resume()
Summary
Testing
fixes issue [BUG]
npm run
erases script output after the final newline #8583