-
Notifications
You must be signed in to change notification settings - Fork 83
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
Documentation for DISABLE_NEWLINE_AUTO_RETURN is wrong #132
Comments
https://github.com/MicrosoftDocs/Console-Docs/blob/main/docs/includes/console-mode-flags.md is the source file, drafting some potential content here to update the documentation to more accurately reflect the flag behavior. DISABLE_NEWLINE_AUTO_RETURN: When writing with WriteFile or WriteConsole, this prevents the cursor from automatically moving to the next line when text reaches the end of the line. The written character will be printed in the final position on the line and the cursor will remain above this character as if ENABLE_WRAP_AT_EOL_OUTPUT was off, but the next printable character will be printed as if ENABLE_WRAP_AT_EOL_OUTPUT is on. No overwrite will occur. Specifically, the cursor quickly advances down to the following line, a scroll is performed if necessary, the character is printed, and the cursor advances one more position. The typical usage of this flag is intended in conjunction with setting ENABLE_VIRTUAL_TERMINAL_PROCESSING to better emulate a terminal emulator where writing the final character on the screen (../in the bottom right corner) without triggering an immediate scroll is the desired behavior. ENABLE_VIRTUAL_TERMINAL_PROCESSING Additionally this adds an additional state to end-of-line wrapping that can delay the cursor move and buffer scroll operations. Normally when ENABLE_WRAP_AT_EOL_OUTPUT is set and text reaches the end of the line, the cursor will immediately move to the next line and the contents of the buffer will scroll up by one line. In contrast with this flag set, the scroll operation and cursor move is delayed until the next character arrives. @j4james would this content be more correct/align with the flag functions? |
I think the Usually when you output a linefeed character (U+000A), the cursor is moved down a line, and also moved across to the leftmost column (essentially executing a carriage return). However, when the |
Thank you @j4james, I worked on incorporating that clarification into the document's pull request. |
@pizzaz93 The changes to It doesn't have anything to do with |
@j4james I edited the text to more closely align with documenting that behavior, does this look correct? Should the second paragraph be removed entirely? | DISABLE_NEWLINE_AUTO_RETURN 0x0008 | When writing with WriteFile or WriteConsole, this flag changes end-of-line behavior. Normally when a linefeed character is outputted (U+000A), the cursor will immediately move to the next line and also move across to the leftmost column (carriage return). In contrast with this flag set, the carriage return is skipped, the cursor moves down a line, but remains in the same column it started from. |
Yeah. The second paragraph should be removed entirely. |
@DHowett or @zadjii-msft, I've implemented @j4james's feedback would you be able to review the referenced PR? |
I'd completely forgotten about this and it just bit us over at vezel-dev/cathode#156. Would be good if we could get this very wrong documentation corrected. It's a bit discouraging to see that #262 went ignored... |
…ked mode. The docs are super wrong: MicrosoftDocs/Console-Docs#132 Closes #156.
The highly misleading docs issue about DISABLE_NEWLINE_AUTO_RETURN is known since 2020, and yet the docs are still not fixed - https://github.com/MicrosoftDocs/Console-Docs/blob/main/docs/includes/console-mode-flags.md and also not at the "real" docs site - https://learn.microsoft.com/en-us/windows/console/setconsolemode . Please fix the docs. The console is complex enough on its own. Highly misleading docs don't help... Also, as far as I can tell from my own testing, it seems that ENABLE_VIRTUAL_TERMINAL_PROCESSING also does what the wrong DISABLE_NEWLINE_AUTO_RETURN docs still say, and also make the console ignore the ENABLE_WRAP_AT_EOL_OUTPUT bit. I.e. when VT is enabled it also enables the "additional state at EOL where the cursor stays once at the last column, and another char will then make it wrap" (to prevent scroll etc), and it's impossible to disable wrap-at-eol, and it's also impossible to disable auto-return. I don't think it's necessarily a bad thing, but it would be nice to have it documented. |
See: microsoft/terminal#4126 (comment)
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: