-
Notifications
You must be signed in to change notification settings - Fork 389
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
\r\n for TxtFormatter in raw consoles #269
Comments
Oh, that's interesting. What's the best way to test it? |
type: a, b, c, t, d, e, f, q t toggles on injecting a CR
There's multiple cases, I think, where \n is translated to \r\n. https://man7.org/linux/man-pages/man3/termios.3.html including even O_POST. I'd probably recommend against testing this with terminals though, since CR support might be useful for other cases such as Windows-style output or other systems that just happen to expect \r\n. It just happened to be that I noticed this with raw terminal mode enabled. |
I think |
Correct. But I could argue that we shouldn't rewrite the user's log text itself. That could produce unexpected results if users think they are getting verbatim output, and it may require another scan through memory plus additional logic to inject the FWIW, I'd think of this more as supporting environments that just happen to expect a |
For terminals in raw mode, a \n alone does not reset the character position to column 0. Modifying TxtFormatter.h to optionally accept a bool for characterReturn could fix this.
I'd be happy to submit a PR, but wanted to check if you are open to accepting this type of patch given it is probably relatively rare.
The text was updated successfully, but these errors were encountered: