Add code to ignore OSC commands - #2326
Conversation
CircuitPython 8 uses OSC to set title.
np, thanks for the fast review!
Done!
Correct OSC commands are Operating System Commands that were defined by xterm early on. A couple of them are specific to setting the terminal title. (Icon name is the text for the window's icon in a task bar.) Here are two good references: |
| r"\x1B\[(?P<count>[\d]*)(;?[\d]*)*(?P<action>[A-Za-z])" | ||
| ) | ||
| self.osc_regex = re.compile( | ||
| r"\x1B\](?P<command>[\d]*);(?P<string>[^\x1B]*)\x1B\\" |
There was a problem hiding this comment.
Should this regex not start with r"\x1B\[?
There was a problem hiding this comment.
No wait, I was looking at the wrong command, nevermind, this is the one to match: https://terminalguide.namepad.de/seq/osc-0/
carlosperate
left a comment
There was a problem hiding this comment.
Looks good! 👍
Tested with a real device as well and works well, thanks!
CircuitPython 8 uses OSC to set title.