-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Resolve a problem of 1024 bytes limited help message in some terminals. #10980
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
Hi @Dafrok, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@@ -667,7 +667,7 @@ namespace ts { | |||
} | |||
|
|||
function printHelp() { | |||
let output = ""; | |||
const output: any = []; |
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.
string[]
and not any
} | ||
} | ||
|
||
sys.write(output); | ||
output.forEach(function (val: any) { |
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.
no need for the type annotation. it is inferd from the type of output
.
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.
use for (const line of output)
instead. forEach does not exist on ES3 engines.
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.
a few changes.
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.
👍
Description
Some terminals cannot excute a single line out of 1024 bytes. When users want to check the help message by typing tsc or tsc --help, They may get a 1024 bytes length broken message.
I have no idea about if using console.log here is better or not, so I fixed the output rule to echo the help message line by line.
Enviroment
TypeScript Version: 1.8.10
Node.js Version: 6.2.0
System Version: OS X El Capitan 10.11.6
Reproduction
** or get in the main menu
Packages -> platformio-ide-terminal -> Toggle` to open the terminal in ATOM.Input
Expected output
Actual output
Remark
Not only my terminal, I googled the 1024 bytes limit is appeared in such a lot of cases.