chrisbra / Colorizer

color hex codes and color names
547 stars 30 forks source link

Bold ANSI code not supported #76

Closed daveyarwood closed 2 years ago

daveyarwood commented 4 years ago

I'm evaluating Colorizer to see if it can interpret ANSI escape codes in a Clojure REPL buffer, and I'm thrilled to see that it works for the most part! One thing I noticed is that the \e[1m (bold) escape code doesn't appear to be working. See my screenshots in https://github.com/Olical/conjure/issues/53#issuecomment-552614727 (that post and the one above it) for context.

Here are a couple more screenshots, with and without colorizer enabled, so you can see the ANSI codes:

2019-11-11-162458_921x164_scrot

2019-11-11-162509_914x163_scrot

One thing that's interesting is that Vim prints a grayed-out ^[ where we would expect the escape character \e:

^[[1mExecuting:  ^[[1mtesting bold^[[1m...^[[0m

I think this is actually:

\e[1mExecuting:  \e[1mtesting bold\e[1m...\e[0m

which you can paste into your terminal (echo -e '\e[1mExecuting: \e[1mtesting bold\e[1m...\e[0m' Executing: testing bold...) and see that it's bold.

Great work on Colorizer, let me know if I can help with this in some way!

chrisbra commented 4 years ago

I believe bold isn't actually supported in a terminal.

daveyarwood commented 4 years ago

I don't follow what you mean.

2019-11-15-100614_461x112_scrot

chrisbra commented 4 years ago

Yes, but highlighting highlighting in vim so not support that

Am 15.11.2019 um 16:06 schrieb Dave Yarwood notifications@github.com:

 I don't follow what you mean.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

daveyarwood commented 4 years ago

Surely it's possible? I'm not sure what is enabling this functionality, but whenever I write comments that contain words like TODO, or FIXME, Vim makes them bold:

2019-11-15-144546_267x81_scrot

(I also have Vim setup to make comments italic -- you can ignore that part)

chrisbra commented 4 years ago

Hmm indeed, will investigate

Am 15.11.2019 um 20:47 schrieb Dave Yarwood notifications@github.com:

 Surely it's possible? I'm not sure what is enabling this functionality, but whenever I write comments that contain words like TODO, or FIXME, Vim makes them bold:

(I also have Vim setup to make comments italic -- you can ignore that part)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

chrisbra commented 2 years ago

I had some look, but this would involve getting the syntax element at the current cursor position and add the bold attribute to it. I don't think this is worth it.

chrisbra commented 2 years ago

should be there now