Skip to content

Issue 180 filter escape sequences#270

Merged
eldipa merged 3 commits intomasterfrom
Issue-180-Filter-Escape-Sequences
Oct 29, 2022
Merged

Issue 180 filter escape sequences#270
eldipa merged 3 commits intomasterfrom
Issue-180-Filter-Escape-Sequences

Conversation

@eldipa
Copy link
Copy Markdown
Collaborator

@eldipa eldipa commented Oct 29, 2022

Closes #180 , related with #263

We use a simplified WSPassthroughStream stream to handle any
non-trivial escape sequence (whitespace like newlines and tabs are
passed through).

Then, the stream will call to the event handlers of a simplified
LinearScreen.

This screen will not emulate a 2D screen but just a linear list
of data chunks received from the stream and it will emulate only the
most basic escape sequences and ignore the rest.

The combination of WSPassthroughStream and LinearScreen in processing
the data read from the interpreter *before* being processed by pexpect
makes possible the filtering without breaking the pexpect regex/prompt
matching, nor breaking pre-existent examples that depend on whitespace
nor adds any significant overhead to the runtime.

This filtering can be optionally disabled with `-filter-esc-seqs`. For
terminals other than `dumb`, no filtering is applied.

See #180
@eldipa eldipa added this to the 11.0.0 milestone Oct 29, 2022
@eldipa eldipa force-pushed the Issue-180-Filter-Escape-Sequences branch from 15f5d3d to 42712c2 Compare October 29, 2022 02:18
@eldipa eldipa force-pushed the Issue-180-Filter-Escape-Sequences branch from 42712c2 to 11ad081 Compare October 29, 2022 02:24
@eldipa eldipa merged commit fb75e51 into master Oct 29, 2022
@eldipa eldipa deleted the Issue-180-Filter-Escape-Sequences branch October 29, 2022 02:33
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

Successfully merging this pull request may close these issues.

Filter ANSI escape sequences for terminal colors as a new term type

1 participant