Skip to content

Improvement escape sequence readerbility for debug #5

@s2quake

Description

@s2quake

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions