Skip to content

Support italic style in printstyled.#45164

Merged
vtjnash merged 1 commit intomasterfrom
fe/italic
Feb 13, 2023
Merged

Support italic style in printstyled.#45164
vtjnash merged 1 commit intomasterfrom
fe/italic

Conversation

@fredrikekre
Copy link
Copy Markdown
Member

No description provided.

@fredrikekre fredrikekre added the display and printing Aesthetics and correctness of printed representations of objects. label May 3, 2022
@fredrikekre fredrikekre requested a review from KristofferC May 4, 2022 21:01
@KristofferC KristofferC added the merge me PR is reviewed. Merge when all tests are passing label May 9, 2022
Copy link
Copy Markdown
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

We did not include this because it does not reliably make it italic, except on monochrome monitors. On color monitors, it may invert the colorscheme instead:

macOS Terminal running tmux:
image

macOS Terminal not running tmux:
image

https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

@vtjnash vtjnash removed the merge me PR is reviewed. Merge when all tests are passing label May 9, 2022
@vtjnash
Copy link
Copy Markdown
Member

vtjnash commented May 9, 2022

Note that even this support might be quite recent, since people were writing blogs about it not working within the past few years: https://weibeld.net/terminals-and-shells/italics.html

@fredrikekre
Copy link
Copy Markdown
Member Author

Rebased. I included a note about terminal support in the docstring.

@fredrikekre fredrikekre requested a review from vtjnash February 13, 2023 13:31
@vtjnash vtjnash merged commit 488ec2c into master Feb 13, 2023
@vtjnash vtjnash deleted the fe/italic branch February 13, 2023 21:20
@tecosaur
Copy link
Copy Markdown
Member

It's worth noting (and I think short of the docs a comment here has a chance of being seen at least) that italic support can be checked for in terminfo, and so the best practice would be adapting the printing behavior based on the terminal capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

display and printing Aesthetics and correctness of printed representations of objects.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants