bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which terminal is similar to dumb but with color support?


From: Peng Yu
Subject: Re: Which terminal is similar to dumb but with color support?
Date: Sun, 31 May 2015 20:06:05 -0500

Hi Thomas,

>> The following command can not print the output in color format.
>>
>> vim -T dumb -c 'echohl ErrorMsg' -c 'echo "Hello World!"' -c q
>
> That's expected.  By the way, vim is not using the terminal description
> from ncurses for "dumb", which looks like this:
>
>         dumb|80-column dumb tty,
>                 am,
>                 cols#80,
>                 bel=^G, cr=^M, cud1=^J, ind=^J,

I only know using tput to check the info about a terminal. But I have
explicit specific the capname. How can you extract all the information
above a terminal as you did above? Thanks.

$ tput -T dumb cols

> I can see that it is not using the terminal description because it uses
> cursor-positioning (which is absent from "dumb"):
>
>         \n\f
>         \E[40;1HHello World!\r\r\r
>         \n

I got this. How did you get the more readable format as the above? Thanks.

$ vim -T dumb -c 'echohl ErrorMsg' -c 'echo "Hello World!"' -c q|cat -v
Vim: Warning: Output is not to a terminal
^L^[[78;1HHello World!^M^M


>> The following command can print the output in color format. But it
>> also print a lot of empty lines.
>>
>> vim -T xterm-colors -c 'echohl ErrorMsg' -c 'echo "Hello World!"' -c q
>
> Actually, I get just a reverse-video (no color).
> Again, whatever vim uses for "xterm-colors" is not from ncurses.
> (Perhaps you meant "xterm-color", although that also gave me no color).
>
>> I just want to print the output in color with vim without print a lot
>> of empty lines.
>
> If it is printing empty lines, that likely is because the description
> that vim uses says that the terminal does not implement the "clear"
> capability, and is simulating it.
>
>> I have tried to tput to check all the terminals in my system (Mac and
>> Ubuntu). But it is hard to find what I want. Could anybody let me know
>> there is such a terminal available? Thanks.
>
> It is unlikely that one exists; you might be able to write a terminal
> description which makes vim do what you want.

Do you know where I should start? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]