You are not logged in.
I apologize for asking a Linux specific question. I hope this is still in the context of this forum.
I ran ArchLinux without X. I'm using Arch as a means to learn Linux and for now I'm only interested in the console. As I started dwelling, in colors I bumped into the first problem in these past weeks for which I cannot find a clear answer by searching here, on the wiki, or even on google.
My shell is Bash. Can I use it in 256 color mode or is this only supported by terminals running a shell?
My current framebuffer resolution supports it (1366x768 24bit). But can bash? I cannot seem to enable it. This is what I was trying to do in .bashrc:
function ECOLOR () { echo -ne "\[\033[38;5;$1m\]"; }
export PS1="`ECOLOR 172`\u@\h \W \$\[\033[0m\] "
Moderator edit: topic title clarified
Last edited by marfig (2010-07-31 12:52:24)
I probably made this post longer than it should only because I lack the time to make it shorter.
- Paraphrased from Blaise Pascal
Offline
The number of colors available in your command line depends on the terminal, not the shell. Also, I believe the only way to achieve 256-colors in the linux console/tty/vc is to hack the kernel, since it only supports 8 colors reguardless of the resolution/depth.
Offline
I was thinking that the framebuffer console (fbcon) also took over the color resolution of the VT100 terminal emulator in the kernel, as it does for the display resolution.
So bit depth in fb is only to guarantee terminal support?
I probably made this post longer than it should only because I lack the time to make it shorter.
- Paraphrased from Blaise Pascal
Offline
Well, you can use some framebuffer devices to display images and set a background image... but the text colors are still limited by the kernel's definitions.
I may not be saying this entirely correct, so hopefully someone else can come in and fully explain the situation.
Last edited by Square (2010-07-31 04:15:00)
Offline
Is your question whether you can get 256 colour support on ttys? Or on terminal emulators, like the ones you use in a WM?
Edit: since you're running without X, it's a tty. I'm changing your topic title.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
This is quoted from somewhere in the net:
"Although the Linux frame-buffer supports 256 (or more) colors, the Linux console driver does not; therefore, console applications are still limited to 16 colors on the Linux console, frame-buffer or not."
This is a decades old problem. As far as I know it would be a major task to alter the linux console color capabilities. Thus nobody succeded so far. Unless you find another console which directly works on the framebuffer there will be no 256-colors capability on TTY.
To know or not to know ...
... the questions remain forever.
Offline
Unless you find another console which directly works on the framebuffer there will be no 256-colors capability on TTY.
And they exist so don't feel dissuaded.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
bernarcher wrote:Unless you find another console which directly works on the framebuffer there will be no 256-colors capability on TTY.
And they exist so don't feel dissuaded.
Quite. I found a few quite some time ago as well. But I lost the references.
Could you provide some pointers?
To know or not to know ...
... the questions remain forever.
Offline
I haven't used any, but sure. *points to Google*
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Excellent folks. This is more than solved.
Thank you for all the input.
Last edited by marfig (2010-07-31 12:51:52)
I probably made this post longer than it should only because I lack the time to make it shorter.
- Paraphrased from Blaise Pascal
Offline
Sorry if i write here but how did you resolve marfig? I've installed fbterm but tty stille have 8 colors....
Offline
Sorry if i write here but how did you resolve marfig? I've installed fbterm but tty stille have 8 colors....
xterm has a 256 color mode extension, FbTerm also add it in this version. 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)and 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", you need run "TERM=fbterm /path/to/program" to enable 256 color mode.
Source: http://code.google.com/p/fbterm/
Offline
in tty i run TERM=fbterm /usr/bin/fbterm but it remains with 8 colors...
Offline
in tty i run TERM=fbterm /usr/bin/fbterm but it remains with 8 colors...
Try:
export TERM=fbterm && fbterm
Offline
Don't change...tput colors: 8
Offline
Don't change...tput colors: 8
http://code.google.com/p/fbterm/issues/detail?id=29
Have you tried google?
Offline
Don't work...i'm trying everything....
Offline
Are you sure you tried this part:
To enable 256 color mode only when fbterm is active, you may execute 'FBTERM=1
fbterm', and add '[ -n "$FBTERM"] && export TERM=fbterm' to the end of ~/.bashrc
if the shell is bash.
?
This works for me.
Last edited by Ashren (2011-09-07 20:02:48)
Offline
The output is 256, but color remains to 8 bit....
Offline
Isn't 8 bit=256?
Offline