You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In bash apparently \[ and \] (common in shell prompts) get turned into SOH (0x01) and STX (0x02) respectively. However, I believe they are not being handled correctly by the parser in Stream, which results in sequences like \x02text being passed to Screen.draw(), which bails on the first control character it encounters (and therefore skips over text).
So a minimal solution (which works for me) would just be to add SOH and STX to the _special set so that they aren't treated as plain text. But maybe all of the control characters (0x00-0x1F) should be excluded as well?
In bash apparently
\[
and\]
(common in shell prompts) get turned intoSOH
(0x01) andSTX
(0x02) respectively. However, I believe they are not being handled correctly by the parser inStream
, which results in sequences like\x02text
being passed toScreen.draw()
, which bails on the first control character it encounters (and therefore skips overtext
).The DebugStream gives:
The root cause seems to be the following regex to match "plain text":
pyte/pyte/streams.py
Lines 134 to 140 in 636b679
Which is then used to find chunks of plain text that can be passed to draw():
pyte/pyte/streams.py
Lines 190 to 206 in 636b679
So a minimal solution (which works for me) would just be to add SOH and STX to the
_special
set so that they aren't treated as plain text. But maybe all of the control characters (0x00-0x1F) should be excluded as well?Here is a quick patch. Happy to make a PR: master...moyix:pyte:moyix/fix_ctrl_chars
The text was updated successfully, but these errors were encountered: