command_kit.rb icon indicating copy to clipboard operation
command_kit.rb copied to clipboard

Add italics support

Open javierjulio opened this issue 7 months ago • 3 comments

I've been using command_kit in a few personal projects and having a great time. Thank you. I have modified the Colors module to include italics support for one project. I'd like to contribute that. Would you accept a PR?

javierjulio avatar May 25 '25 22:05 javierjulio

The reason why I avoided adding support for Italic is it's apparently not widely supported and some terminals incorrectly interpret it as inverted or blink? https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters

postmodern avatar May 26 '25 01:05 postmodern

I came across that resource too when looking up support but the reference is from 2003. I tried italics in macOS Terminal which is what I use daily and it works great. I wonder if it's better supported nowadays whereas before it may not have been (resource)? I think it would be helpful to have for those that would want to use it. Would you be open to a PR for adding it and including that link as a callout that some terminals may not support it properly?

javierjulio avatar May 26 '25 06:05 javierjulio

@javierjulio hmm of the listed terminals that do not support italic, rxvt, mate-terminal, xfce-terminal, and PuTTY are still somewhat popular. At least most all of the other popular terminals are supported.

I've rarely if ever seen italic text in the terminal. I'm curious what you or others would use italic ANSI fonts for?

postmodern avatar May 26 '25 16:05 postmodern