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

Improvement escape sequence readerbility for debug #5

Open
s2quake opened this issue Mar 10, 2024 · 0 comments
Open

Improvement escape sequence readerbility for debug #5

s2quake opened this issue Mar 10, 2024 · 0 comments

Comments

@s2quake
Copy link
Owner

s2quake commented Mar 10, 2024

As you can see below, the escape sequence string in the debug console is hard to understand.
It's hard to see exactly what is being processed and how.
It seems like we need a DOM-like data structure to make it more readable.
And the string should probably be represented as json.

Read: \u001b[H\u001b[2J\u001b[H\u001b[H\u001b[2J\u001b[HLS(1)                       General Commands Manual                      LS(1)\r\n\r\n\u001b[1mNAME\u001b[0m\r\n     \u001b[1mls\u001b[0m – list directory contents\r\n\r\n\u001b[1mSYNOPSIS\u001b[0m\r\n     \u001b[1mls\u001b[0m [\u001b[1m-@ABCFGHILOPRSTUWabcdefghiklmnopqrstuvwxy1%,\u001b[0m] [\u001b[1m--color\u001b[0m=\u001b[4mwhen\u001b[24m]\r\n        [\u001b[1m-D\u001b[0m \u001b[4mformat\u001b[24m] [\u001b[4mfile\u001b[24m \u001b[4m...\u001b[24m]\r\n\r\n\u001b[1mDESCRIPTION\u001b[0m\r\n     For each operand that names a \u001b[4mfile\u001b[24m of a type other than directory, \u001b[1mls\u001b[0m\r\n     displays its name as well as any requested, associated information.  For\r\n     each operand that names a \u001b[4mfile\u001b[24m of type directory, \u001b[1mls\u001b[0m displays the names\r\n     of files contained within that directory, as well as any requested,\r\n     associated information.\r\n\r\n     If no operands are given, the contents of the current directory are\r\n     displayed.  If more than one operand is given, non-directory operands are\r\n     displayed first; directory and non-directory operands are sorted\r\n     separately and in lexicographical order.\r\n\r\n:\u001b[K
CSI Ps ; Ps H => \u001b[H
CSI Ps J => \u001b[2J
2
CSI Ps ; Ps H => \u001b[H
CSI Ps J => \u001b[2J
CSI Ps ; Ps H => \u001b[H
CSI Pm m => \u001b[1m
CSI Pm m => \u001b[0m
CSI Pm m => \u001b[1m
CSI Pm m => \u001b[0m
CSI Pm m => \u001b[1m
CSI Pm m => \u001b[0m
CSI Pm m => \u001b[1m
CSI Pm m => \u001b[0m
CSI Pm m => \u001b[1m
CSI Pm m => \u001b[0m
CSI Pm m => \u001b[1m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant