Re: ESC[4m does not produce underline OOPS
On 02/03/13 08:46, Thomas D. Dean wrote:
> On 03/01/13 11:35, Thomas D. Dean wrote:
>> The ANSI standard lists ESC[4m as the code to produce an underline
>>
>> > export TERM=ansi80x25
>> > printf "\033[4masdfasdfasdf"
>>
>> produces green text, not underline text as stated in the standard.
>>
>> If I put the same in c code, it works
>>
>> #include <stdio.h>
>> int main() {
>> fputs("\033[4masdfasdf",stdout);
>> return 0;
>> }
>>
>> I get underlined text.
>>
>
> I ran the C example in an xterm on Ubuntu!
>
> The question remains.
>
> Why does this produce color rather than underlined text?
>
> The standard says ESC[32m should produce green text and ESC[4m should
> produce underlined text.
Are you doing this on a (colour) linux console, rather than an xterm?
Apparently it can't do underline, and simulates it with a different
colour instead. See 'man console_codes', or here:
https://www.kernel.org/doc/man-pages/online/page/man4/console_codes.4.html
I don't think setting TERM will make any difference; it's your program
that has to interpret that (usually via terminfo and associated
libraries) and send the correct escape sequences - but you're sending
them yourself anyway.
Richard
Reply to: