-1

I've turned my dual-boot into a triple-boot and I'm running Ubuntu 16.04 as well as Ubuntu Gnome 14.04.

I've noticed that the terminal output of 14.04 is only coloured for directories. In 16.04 I had much more output that was already coloured that made things easy.

For examples, here is the output of dmesg in 16.04:

16.04

As you can see above, lots of things are coloured to make it easier to skim through. I purposely generated an error here to show how errors are automatically coloured red to make them easier to spot.

Below is the output of dmesg in 14.04:

14.04

As you can see, it's much harder to read.

I've tried setting terminal themes and such, but no automatic colouring. I've also read about a file /etc/terminal-colors.d but I don't have this in 16.04.

How can I export the colouring settings from 16.04 and import them into 14.04? Or is this simply a matter of different versions of the terminal? I'm considering permanently switching over to Ubuntu Gnome 14.04, there's just a few of these things I'd like to update first.

I've already tried uncommenting the force_color_prompt=yes in .bashrc and it didn't change anything.

4
  • This may help: unix.stackexchange.com/questions/95842/… – Chris K Jun 15 '16 at 16:10
  • @ChrisK My question has nothing to do with watching dmesg output, I was just using it as an example. My question is about the colouring. – Delorean Jun 15 '16 at 16:12
  • What kind of things are you interested in coloring ? errors ? – Sergiy Kolodyazhnyy Jun 15 '16 at 19:09
  • @Serg Thing like my first screenshot. Timestamps within brackets, program names and yes, errors. – Delorean Jun 15 '16 at 19:10
4

dmesg on 16.04 supports colouring output, and on 14.04, it doesn't. Just look at the manpages.

  1. 16.04:

    -L, --color[=when]
          Colorize the output.  The optional argument when  can  be  auto,
          never  or  always.  If the when argument is omitted, it defaults
          to auto.  The colors can be disabled, for the  current  built-in
          default see --help output. See also the COLORS section.
    
  2. 14.04: No such option.
3
  • So my example is a specific dmesg version problem and nothing to do with the terminal? Can dmesg be upgraded in 14.04? – Delorean Jun 15 '16 at 17:49
  • You can try manually installing the package from 16.04, but who knows what problems that might cause. I don't think this will be backported. – muru Jun 15 '16 at 17:52
  • Yep, you were right. The colouring is definitely dmesg itself doing it and not the terminal. That's unfortunate since it's the first place I go to when there's problems, but this is the correct answer. Thank you! – Delorean Jun 15 '16 at 18:31
2

Hopefully setting force_color_prompt=yes directive in your .bashrc file will make it work. The force_color_prompt=yes directive is commented by default. Uncomment it, save it and source your .bashrc file to see the changes.

Command for sourcing your .bashrc file is

cd ~
source .bashrc
1
  • I did this previously which I should have mentioned in my question. It didn't change anything. I will update my question to state this. – Delorean Jun 15 '16 at 16:51

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.