Skip to content
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

Added support for the shorthand ESC[m, which is equivalent to ESC[0m #90

Merged
merged 1 commit into from
Jun 6, 2016

Conversation

calebstewart
Copy link
Contributor

Many applications use the shorthand notation for resetting the foreground/background colors, which does not include a parameter. According to the Wikipedia page, the ESC[...m command does not require any parameters:

Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences.

@thomasballinger
Copy link
Member

Oh dear, I forgot that Curtsies has an escape sequence parser in it. Thanks @caleb1994. Someday™ it'd be nice to do https://github.com/thomasballinger/curtsies/issues/8, or at least properly give up without crashing.

@thomasballinger thomasballinger merged commit 1f9974e into bpython:master Jun 6, 2016
@thomasballinger
Copy link
Member

When I test this now I get an error with input like '\x1b[35mx\x1b[m', so I've fixed this and added a test in 0b5ad9b1df82af284c7c6a112609d047eb4b2ca2

thomasballinger added a commit that referenced this pull request Jul 29, 2016
@calebstewart calebstewart deleted the reset-escape-code branch August 7, 2016 20:26
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.

2 participants