0

I've had this issue for a little while now on a few machines, but never thought to ask anyone.

Upon installing a new laptop the other day, and using the virtual terminal for a bit, I noticed that colours were a bit off.

Here is what it should look like:

enter image description here

Here is what it shows on a virtual console:

enter image description here

Is there anything special that needs to be done to get this working correctly? I've been looking for a little while tonight, and so far haven't found a great deal of information.

  • 1
    Linux terminals are 16-color. The former image appears to not be in a virtual console (as evidenced by the antialiasing, among other things), but in an X terminal emulator of some sort. Have you tried this in an X terminal? – Chris Down Jan 28 '14 at 12:56
  • Yes, the former definitely isn't a virtual console (Terminal on a Mac). I have tried in an X terminal emulator, and it does give the colours, but I'm wanting to see if there is a way to get this without X. – xeon927 Jan 28 '14 at 13:02
  • 1
    This Q&A discusses the possibility. The top answer (from quack quixote) claims it is possible, but that person has obviously not tested any of the ideas s/he suggests. The 2nd answer (from pbr) makes much more sense -- not impossible, but would require a kernel patch. – goldilocks Jan 28 '14 at 13:16
0

So, after a bit more searching, I found a solution. It may not be the most exotic solution, but hey, it works. Turns out, with screen running under fbterm, colours work as they should, straight in the linux framebuffer.

To get it working, I made sure that I had a copy of GNU Screen (apt-get install screen), and compiled a copy of FBTerm from source (https://code.google.com/p/fbterm/), then, after a bit of playing around, finally ended up with this to add to my .bashrc file:

if [[ "`tty`" == /dev/tty* || ${SHLVL} -eq 2 ]]; then
  export TERM=fbterm
  if [ ${SHLVL} -eq 1 ]; then
    ((SHLVL+=1)); export SHLVL
    exec fbterm
  elif [ ${SHLVL} -eq 2 ]; then
    ((SHLVL+=1)); export SHLVL
    exec screen -d -R -q
  fi
fi

If anyone has improvements they might like to add, feel free to comment on this answer or propose an edit (or something).

Hopefully this helps someone other than just myself :)

  • The only issue with this that I find is that because I run a screen/tmux session on the server that I SSH to, which means that a normal Ctrl-a for screen now actually needs a Ctrl-a a to trigger on the server. To fix this, you could just modify your .screenrc file to change the modifier key (see gnu.org/software/screen/manual/screen.html#Command-Character) – xeon927 Jan 30 '14 at 13:54
  • I've made an edit, because as I just found out, this doesn't work in an X terminal, as fbterm will not run. To fix this (seeing as fbterm only needs to run when not using X), I added a check for whether or not the terminal is running on a framebuffer, if yes, then start the custom scripty bit. :) – xeon927 Feb 4 '14 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.