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

reset #49

Open
szepeviktor opened this issue Jun 1, 2014 · 9 comments
Open

reset #49

szepeviktor opened this issue Jun 1, 2014 · 9 comments
Labels
needs-info This issue/PR needs more information to progress.

Comments

@szepeviktor
Copy link
Contributor

This is a very fine script!

Could you please handle reset?

# tput sgr0|hexdump  -C
00000000  1b 28 42 1b 5b 6d                                 |.(B.[m|
@szepeviktor
Copy link
Contributor Author

And please add this to pre's style to break long lines:

    white-space: pre-wrap;
    word-wrap: break-word;

@ralphbean
Copy link
Collaborator

And please add this to pre's style to break long lines:

This would be an easy pull-request. Would you like to be the one to add it?

@szepeviktor
Copy link
Contributor Author

Please handle tput sgr0: revert back the current schema's color OR tell me how to reset that your script understands.

@szepeviktor
Copy link
Contributor Author

http://manpages.ubuntu.com/manpages/hardy/man5/terminfo.5.html

s0ds         s0        Shift to codeset 0 (EUC set 0, ASCII)
...
s0ds=\E(B

So \E(B is "Shift to codeset 0". I do not know what it is.
I'd like to just "turn off all attributes" by tput.

@ralphbean
Copy link
Collaborator

I'll take a look at handling sgr0 when I can. It seems like it would need to close as many </span> tags as had been opened.

@szepeviktor
Copy link
Contributor Author

Very dirty.

cat "${HC_LOG}.txt" \
    | ansi2html --title="$HC_DOMAIN" --linkify --font-size=13px --light-background -s xterm \
    | sed 's/\x1B(B\b//g' > "${HC_LOG}.html"

@wookayin
Copy link

A 3-year-old bug still not resolved? :(

@hartwork
Copy link
Collaborator

hartwork commented Feb 3, 2022

And please add this to pre's style to break long lines:

    white-space: pre-wrap;
    word-wrap: break-word;

That was added in 2014 for release 1.0.7 by commit 418bef2 .

@hartwork
Copy link
Collaborator

hartwork commented Feb 3, 2022

Could you please handle reset?

# tput sgr0|hexdump  -C
00000000  1b 28 42 1b 5b 6d                                 |.(B.[m|

I'm unsure about how that^^ sgr0 differs from \x1b[0m (Wikipedia) semantically (if so). The latter is supported…

# hexdump -C <<<$'\x1b[0m'
00000000  1b 5b 30 6d 0a                                    |.[0m.|
00000005

# echo $'\x1b[31mhello red\x1b[0m and hello normal' | ansi2html --inline
<span style="color: #aa0000">hello red</span> and hello normal

…since 2013 release 0.10.0 commit fce66a6.

@hartwork hartwork added the needs-info This issue/PR needs more information to progress. label Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info This issue/PR needs more information to progress.
Projects
None yet
Development

No branches or pull requests

4 participants