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

repl,util: insert carriage returns in output #8028

Merged
merged 1 commit into from
Aug 13, 2016
Merged

repl,util: insert carriage returns in output #8028

merged 1 commit into from
Aug 13, 2016

Conversation

JungMinu
Copy link
Member

@JungMinu JungMinu commented Aug 9, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

repl, util

Description of change

\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

@nodejs-github-bot nodejs-github-bot added repl Issues and PRs related to the REPL subsystem. util Issues and PRs related to the built-in util module. labels Aug 9, 2016
@JungMinu JungMinu self-assigned this Aug 9, 2016
@JungMinu
Copy link
Member Author

JungMinu commented Aug 9, 2016

@addaleax
Copy link
Member

I guess this looks okay (and semver-major-y?) but tbh I didn’t really understand the problem it is supposed to solve… usually TTYs should have their ONLCR flag set by default, translating \n to \r\n?

@mscdex
Copy link
Contributor

mscdex commented Aug 10, 2016

@addaleax I'm not sure why it was happening that way, but that is the problem I was running into with a module I wrote.

@JungMinu
Copy link
Member Author

@mscdex PTAL, LGTY?

@mscdex
Copy link
Contributor

mscdex commented Aug 11, 2016

There are still various places that still only use \n, especially anything that is written to the outputStream.

@JungMinu
Copy link
Member Author

@mscdex Done, PTAL again :)

@JungMinu
Copy link
Member Author

@mscdex If LGTY, I will run a new CI

@Fishrock123
Copy link
Contributor

Would it bet better to use os.EOL for this?

@addaleax
Copy link
Member

See #7954 (comment) … so, apparently no, but I’d still really like to understand what the real problem here is that this is trying to solve.

@JungMinu
Copy link
Member Author

gentle ping @mscdex

@mscdex
Copy link
Contributor

mscdex commented Aug 13, 2016

I think that should do it. LGTM if CI is ok with it.

@JungMinu
Copy link
Member Author

@JungMinu
Copy link
Member Author

CI is green :)

`\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>
@JungMinu JungMinu merged commit fce4b98 into nodejs:master Aug 13, 2016
@JungMinu
Copy link
Member Author

Landed in fce4b98

cjihrig pushed a commit that referenced this pull request Aug 15, 2016
`\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>
This was referenced Aug 15, 2016
@evanlucas
Copy link
Contributor

I feel like this should have been marked as a breaking change.

@yorkie
Copy link
Contributor

yorkie commented Aug 17, 2016

+1 on marking as breaking change.

@Fishrock123 Fishrock123 added the semver-major PRs that contain breaking changes and should be released in the next major version. label Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newlines missing carriage returns in REPL, util.inspect() output
7 participants