Add an additional debug option to show a \n when \r is received #16571

Closed
opened 2026-01-31 05:16:02 +00:00 by claunia · 7 comments
Owner

Originally created by @eabase on GitHub (Feb 1, 2022).

Description of the new feature/enhancement

The debug tool is great, but could certainly be improved if you could add an option to actually do a \n when the \r (CR) character is received. This would significantly increase the readability of the infinite debug strings coming out, without affecting the actual output and understanding.

So that it would look like:

blah blahblah   blah
[C/R] blah blah

(Where [C/R] is the special unicode (\x2400 range) character for \r.)

Proposed technical implementation details (optional)

Add an optional 2nd debug option after the "debugFeatures": true, option.
Name the option: "debugFeature_Show_NL": true.

Originally created by @eabase on GitHub (Feb 1, 2022). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement The debug tool is great, but could certainly be improved if you could add an option to actually do a `\n` when the `\r` (CR) character is received. This would significantly increase the readability of the infinite debug strings coming out, without affecting the actual output and understanding. So that it would look like: ``` blah blahblah blah [C/R] blah blah ``` (Where [C/R] is the special unicode (\x2400 range) character for `\r`.) # Proposed technical implementation details (optional) Add an optional 2nd debug option after the `"debugFeatures": true,` option. Name the option: `"debugFeature_Show_NL": true`.
Author
Owner

@zadjii-msft commented on GitHub (Feb 1, 2022):

I'm tempted to just outright reject this - I actually quite like that every character that's emitted to the debug tap is turned into a printable character. It gets rid of any guesswork as to whatever the line discipline is supposed to be. You can just look at the output and know "yep, there was the CR, there's the NL, the BS SPC BS", etc.

@DHowett is the father of the debug tap so I'll give him the final say. If anything, the setting should probably be debugFeature.showNewlines, since we're sorta using the dot notation for things like that

@zadjii-msft commented on GitHub (Feb 1, 2022): I'm tempted to just outright reject this - I actually quite like that every character that's emitted to the debug tap is turned into a printable character. It gets rid of any guesswork as to whatever the line discipline is supposed to be. You can just look at the output and know "yep, there was the CR, there's the NL, the BS SPC BS", etc. @DHowett is the father of the debug tap so I'll give him the final say. If anything, the setting should probably be `debugFeature.showNewlines`, since we're sorta using the dot notation for things like that
Author
Owner

@eabase commented on GitHub (Feb 1, 2022):

The problem is only of readability, because when you are doing something on CLI/prompt, the debug output is always misaligned, so it's very hard to read where was the last place something was output/input. So being able to add a real newline where there are, either an \n or a \r, in addition to the unicode block symbol for that, would really help the readablity and alignment. Everything else is great and remain the same. The symbols are all there, only occasionally separated by a visible newline.

An additional advantage is that of copy pasting the debug output. If you don't have a visible \n (or \r) you will get the entire copied part, in one very long string. Not very practical for reporting and including in bug reports.

@eabase commented on GitHub (Feb 1, 2022): The problem is only of readability, because when you are doing something on CLI/prompt, the debug output is always misaligned, so it's very hard to read where was the last place something was output/input. So being able to add a *real* newline where there are, either an `\n` or a `\r`, in addition to the unicode block symbol for that, would really help the readablity and alignment. Everything else is great and remain the same. The symbols are all there, only occasionally separated by a visible newline. An additional advantage is that of copy pasting the debug output. If you don't have a visible `\n` (or `\r`) you will get the entire copied part, in one very long string. Not very practical for reporting and including in bug reports.
Author
Owner

@j4james commented on GitHub (Feb 1, 2022):

I don't feel strongly about this one way or the other, but if we were going to have this feature, I'd expect it to be trigger by a \n rather than a \r, and I'd also expect the line break in the log to come after the output of the control character. For example, something like this:

C:\>␛[13;28;13;1;0;1_␛[13;28;13;0;0;1_␍␊
C:\>

This is similar to what you'd see if you've enabled visible whitespace in a text editor.

@j4james commented on GitHub (Feb 1, 2022): I don't feel strongly about this one way or the other, but if we were going to have this feature, I'd expect it to be trigger by a `\n` rather than a `\r`, and I'd also expect the line break in the log to come *after* the output of the control character. For example, something like this: ``` C:\>␛[13;28;13;1;0;1_␛[13;28;13;0;0;1_␍␊ C:\> ``` This is similar to what you'd see if you've enabled visible whitespace in a text editor.
Author
Owner

@eabase commented on GitHub (Feb 1, 2022):

This is similar to what you'd see if you've enabled visible whitespace in a text editor.

Even better! 👍

@eabase commented on GitHub (Feb 1, 2022): > This is similar to what you'd see if you've enabled visible whitespace in a text editor. Even better! 👍
Author
Owner

@DHowett commented on GitHub (Jun 29, 2022):

Honestly, I think we should probably just do this all the time and without a setting. Right now, the debug tap is incapable of producing a physical CR/LF, so adding one would be adding valuable clarifying whitespace without adding confusion as to where that whitespace came from.

Thanks for the request, and I'm sorry I missed this thread the first time!

@DHowett commented on GitHub (Jun 29, 2022): Honestly, I think we should probably just do this all the time and without a setting. Right now, the debug tap is incapable of producing a physical CR/LF, so adding one would be adding valuable clarifying whitespace without adding confusion as to where that whitespace came from. Thanks for the request, and I'm sorry I missed this thread the first time!
Author
Owner

@ghost commented on GitHub (Aug 5, 2022):

:tada:This issue was addressed in #13475, which has now been successfully released as Windows Terminal v1.14.196.🎉

Handy links:

@ghost commented on GitHub (Aug 5, 2022): :tada:This issue was addressed in #13475, which has now been successfully released as `Windows Terminal v1.14.196`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.14.196) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Aug 5, 2022):

:tada:This issue was addressed in #13475, which has now been successfully released as Windows Terminal Preview v1.15.200.🎉

Handy links:

@ghost commented on GitHub (Aug 5, 2022): :tada:This issue was addressed in #13475, which has now been successfully released as `Windows Terminal Preview v1.15.200`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.15.200) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16571