powerman/vim-plugin-AnsiEsc

clarification in the usage of g:ansiBold ?

Closed this issue · 3 comments

Hello

Thank you for this plugin,

In the rendering, I have an issue with the Bold , by example :

�[0m�(B�[34;40mIn mytext �[0m�(B�[37;40m�[1;41r�[41;1H

there is the color but no the Bold

in the documentation, I don't understand how to set the global variable : g:ansiBold ?
I guess if it would solve my rendering color issue of Bold text,

Ps : I verified on the version: Updated Jul 21, 2020 (v13t)

Regards,
Frédéric

Well, I'm not sure what's ESC ( B supposed to mean in your example. If it's supposed to mean BOLD then correct sequence is ESC [ 1 m.

Here is my example with simple bold plus your example with (B replaced by [1m:
изображение
Now I run :AnsiEsc and get this:
изображение
It may be hard to see, but "bold" on first line is not only in different color, but it's also a real bold font. May be easier to spot if compared to console output (where it uses the same color):
изображение

I'm not sure what Vim settings should be changed to avoid making bold of different color, but I doubt it has anything with this plugin. So, to me it looks like everything works as expected, but feel free to reopen if you disagree.

Maybe, I did something wrong? Could you advise?

On minicom, I see :
image

This is generated with :

printmsg "Starting daemon $1 ..."
XXX
printres $?

printmsg() {
    msg="$1"
    printf $nocolor;
    printf "%-60s" "$1"
    printf "["; printf $yellow; printf "RUNNING"; printf $nocolor; printf "]"
}

printres() {
    color=$red
    res="FAILED"
    [ $1 -eq 0 ] && res="OK" && color=$green
    printf "\r%-100s" ""; printf "\r%-60s" "$msg"
    printf $nocolor ; printf "["; printf $color; printf $res; printf $nocolor; printf "]\n"
}

I saved the log with :
script -q -c "/usr/bin/minicom -w --color=on" my_log_color.txt

It s doing :

 Starting daemon syslogd ...                                 [�[0m�(B�[32;40m�[1mOK�[0m�(B�[37;40m]
�[1;38r�[38;1H

before enabling the plugin :
image

after enabling it :
image

Console control sequences isn't same as ANSI control sequences. E.g. if you read https://www.systutorials.com/docs/linux/man/4-console_codes/ you'll see ESC ( B is a "Select default (ISO 8859-1 mapping)" and it's not an ANSI code.