You are not logged in.

#1 2016-04-20 08:16:10

satori
Member
Registered: 2013-01-21
Posts: 29

fbterm - how to change default colors?

Hello,

How can I change the colors in fbterm?

I'm using X-less configuration.
In default terminal I can customize colors in .bashrc using escape characters like this:

echo -en "\e]P<color_nb><color_rgb>"

With fbterm these settings are ignored and default colors are used.
Echoing the sequences with escape characters does not have effect.

In fbterm's man page there is section about 256 color extension.

man page wrote:

256 COLOR EXTENSION

       FbTerm  supports  xterm's 256 color mode extension. The first 16 colors
       are the default terminal colors. Additionally, there's  a  6x6x6  color
       cube,  and  24  grayscale tones. But xterm's 256 color escape sequences
       conflict with the linux sequences implemented  by  FbTerm,  so  private
       escape sequences were introduced to support this feature:

           ESC [ 1 ; n }                   set foreground color to n (0 - 255)
           ESC [ 2 ; n }                   set background color to n (0 - 255)
           ESC  [  3 ; n ; r ; g ; b }       set color n to (r, g, b) ,  n, r,
       g, b all in (0 - 255)

       A new terminfo database entry named "fbterm" was  added  to  use  these
       private  sequences,  all program based on terminfo should work with it.
       By default, FbTerm sets environment variable "TERM" to  value  "linux",
       user need run "TERM=fbterm /path/to/program" to enable 256 color mode.

I'm able to get 256 colors mode but have trouble changing them.
Using sequences based on man page:

echo -en "\e[3;0;255;255;255}"
echo -en "\e[3;1;128;128;128}"

I'm able to change background (color 0) to white but I cannot change other colors, like color 1...
It looks like only one color can be modified this way during fbterm session - maybe some more escapes are needed?

I could not find much information regarding this matter.
Any suggestions?

Offline

#2 2016-10-24 01:48:45

xaviergmail
Member
Registered: 2016-10-24
Posts: 1

Re: fbterm - how to change default colors?

I've run into the same brick wall :\ have you managed to find a workaround?

Offline

#3 2016-10-25 22:22:17

blueyed
Member
Registered: 2015-09-19
Posts: 5

Re: fbterm - how to change default colors?

It worked for me:

printf '\e[3;20;0;255;0;}'

A better way seems to be using `tput` instead:

tput initc 16 255 0 0`

I could manage to use "solarized.dark" through the "base16" scheme method.

For some reason however, the colors/font only appeared correctly (and not garbled) after switching VTs back and forth.

Also ensure to use e.g.. TERM=fbterm $SHELL, so that the correct terminfo is used (especially with `tput`).

Offline

Board footer

Powered by FluxBB