-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Newlines missing carriage returns in REPL, util.inspect() output #7954
Comments
Userland is encouraged to use Why not use that in Node.js core libraries? |
Well as I said, for some reason AFAIK using |
I will resolve this issue :) |
So, changing core lib to use
I agree with that. I use |
I'm not sure how you could create a test case to check for visual layout. I think about the best you could do is just to have a test that checks that only |
Yep, I will create a pull request ASAP 😄 |
`\n` is not enough for Linux with some custom stream add carriage returns to ensure that the output is displayed correctly using `\r\n` should not be a problem, even on non-Windows platforms. Fixes: #7954 PR-URL: #8028 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net>
I noticed that the
repl
module andutil.inspect()
only write\n
and not\r\n
in their output.readline
however consistently writes\r\n
to its output.This seemingly causes output problems with custom REPLs with custom output streams. I'm not exactly sure why this is a problem though, since the output streams eventually reach a (Linux) terminal. The current workaround I have is to create a newline conversion stream (that inserts carriage returns) that then pipes to my actual output stream. However, I'd prefer not to have to use this workaround forever.
This should just be a matter of changing the relevant instances of
\n
to\r\n
inlib/repl.js
andlib/util.js
.The text was updated successfully, but these errors were encountered: