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

Carriage return ignored/treated like line feed #79

Open
mwchase opened this issue Nov 15, 2017 · 1 comment
Open

Carriage return ignored/treated like line feed #79

mwchase opened this issue Nov 15, 2017 · 1 comment
Labels
enhancement This issue/PR relates to a feature request.

Comments

@mwchase
Copy link

mwchase commented Nov 15, 2017

I ran across this processing the output from pytest. Its collection phase prints several messages, separating by carriage returns (0D). In the terminal, each of these lines overwrites the previous one, until it gets to the end of the phase, and then in does a line feed (0A). As a result, only the final line is visible. (I believe this only completely works because the lines are padded with spaces.)

When I feed this to ansi2html, every line is visible, as if they were all separated with line feeds.

I started this bug report all gung-ho about "We should fix it, I'll try to submit a pull request" but now that I more fully understand what's going on, I think the prudent thing would be to just document this behavior.

Edit: I talked to someone else, and actually, this might be doable. I'll try to hack something over the weekend.

@hartwork
Copy link
Collaborator

hartwork commented Feb 3, 2022

I agree this is worth improving OR documenting.

For anyone interested, here's how to see it in action:

# echo $'ONE\nTWO\nTHREEEEEE\rFOUR\rFIVE\nSIX\n' | ansi2html --inline | tee /dev/stderr | hexdump -C
ONE
TWO
FIVEEEEEE
SIX

00000000  4f 4e 45 0a 54 57 4f 0a  54 48 52 45 45 45 45 45  |ONE.TWO.THREEEEE|
00000010  45 0d 46 4f 55 52 0d 46  49 56 45 0a 53 49 58 0a  |E.FOUR.FIVE.SIX.|
00000020  0a                                                |.|
00000021

@ssbarnea ssbarnea added enhancement This issue/PR relates to a feature request. and removed feature labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

3 participants