-
Notifications
You must be signed in to change notification settings - Fork 436
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
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: |
@@ -182,6 +182,9 @@ def __init__(self, connection, theme="day", parent=None): | |||
self.vt100_regex = re.compile( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this regex not start with r"\x1B\[
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wait, I was looking at the wrong command, nevermind, this is the one to match: https://terminalguide.namepad.de/seq/osc-0/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
Tested with a real device as well and works well, thanks!
CircuitPython 8 uses OSC to set title.