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

Swap ansi-escapes for a working cross-platform clear #400

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

stramel
Copy link
Contributor

@stramel stramel commented Jun 1, 2020

This swaps out ansi-escapes which we utilized clearTerminal, for a working windows command.

The main difference is just a slight difference in the ESC sequence. This swaps, \u001B[ to \x1B[. This is how Jest and CRA both handle their clearTerminal command.

@FredKSchott feel free to close if you want

@FredKSchott
Copy link
Owner

Works for me! Thanks for taking the time to dig into this, can't believe ansi-escapes doesn't handle this by default

@FredKSchott FredKSchott merged commit 11ca3d0 into FredKSchott:master Jun 1, 2020
@stramel
Copy link
Contributor Author

stramel commented Jun 1, 2020

Their code is nearly identical.

Our new output:

process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H'

vs

ansi-escapes:

process.platform === 'win32' ? '\u001B[2J\u001B[0f' : '\u001B[2J\u001B[3J\u001B[H'

I brought it up in the issue that I had opened over there to see if they would be willing to update their code.

@stramel stramel deleted the fix-windows-output branch June 1, 2020 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants