terminal colors outside of chroot

121 views
Skip to first unread message

Robert Ginda

unread,
Aug 16, 2010, 8:20:21 PM8/16/10
to Chromium OS dev
With the new workflow my diffs show up in pretty colors inside the
chroot, but outside the chroot things don't work so well. Instead of
colors, I see the raw escape codes. I use the same terminal inside
and outside, bash in both instances, and I even use a prompt with VT
colors outside the chroot.

So, does anyone know why diff colors would work inside the chroot, but
not outside?


Rob.

Chris Sosa

unread,
Aug 16, 2010, 8:32:11 PM8/16/10
to Robert Ginda, Chromium OS dev
The trick is probably in your /etc/bash/bashrc in your chroot. I
sourced this file from outside of my chroot and got the same pretty
colors from within my chroot.

-Sosa

> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

--
Chris Sosa
Software Engineer
Chrome OS
Google

Bill Richardson

unread,
Aug 17, 2010, 11:33:55 AM8/17/10
to Chris Sosa, Robert Ginda, Chromium OS dev
It's a git thing. Run "git config --global --list" and you'll probably see something like this:

color.branch=always
color.ui=always
color.diff=always

If you change the settings to "auto" instead "always", it should drop the pretty colors when the output isn't to a terminal.

If you like the pretty colors and want to make it show up properly, you'll need to pass the right args to your pager, using something like

export PAGER='less -R'

or, if you invoke less directly ("git diff | less"), then make that a default arg:

export LESS='-R'



Bill

Robert Ginda

unread,
Aug 17, 2010, 12:39:02 PM8/17/10
to Bill Richardson, Chris Sosa, Chromium OS dev
Aha, that did it, thanks Bill.


Rob.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages