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

Support underline and inverse in ANSI escape codes #2186

Merged
merged 3 commits into from
Feb 14, 2017

Conversation

tonycpsu
Copy link
Contributor

I was dumping output from cdiff into a notebook and noticed that its use of underline and inverse escape codes wasn't being reflected in the notebook output. A couple simple tweaks to the ANSI parsing and some added CSS classes and it now does.

* Parse underline and inverse in ANSI escape codes
* Add CSS classes for same, using a subtle outline for inverse
Copy link
Member

@takluyver takluyver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I briefly tested this and it appears to be working.

"print()\n",
"print (\"{ESC}04mThis is underlined text\".format(**locals()))\n",
"print()\n",
"print (\"{ESC}07mThis is inverse text\".format(**locals()))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that you don't reset the style between lines, so this actually generates:

  • normal
  • bold
  • bold + underlined
  • bold + underlined + inverse

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, good catch. I've updated the test to reset.

@takluyver takluyver added this to the 5.0 milestone Feb 14, 2017
@takluyver
Copy link
Member

Great, thanks. This looks good to me.

@takluyver takluyver merged commit a33d136 into jupyter:master Feb 14, 2017
mgeier added a commit to mgeier/notebook that referenced this pull request Oct 23, 2017
The "inverse" escape sequence was implemented in jupyter#2186, but not by
actually inverting foreground and background.
mgeier added a commit to mgeier/notebook that referenced this pull request Oct 23, 2017
The "inverse" escape sequence was implemented in jupyter#2186, but not by
actually inverting foreground and background.
@mgeier mgeier mentioned this pull request Oct 23, 2017
mgeier added a commit to mgeier/notebook that referenced this pull request Nov 1, 2017
The "inverse" escape sequence was implemented in jupyter#2186, but not by
actually inverting foreground and background.
gnestor pushed a commit that referenced this pull request Nov 1, 2017
* Invert inverse ANSI colors

The "inverse" escape sequence was implemented in #2186, but not by
actually inverting foreground and background.

* ANSI colors: allow switching off underline and inverse

* Add CSS classes ansi-default-inverse-fg and ...-bg
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants