Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been using Arch Linux on my new laptop and I'm trying to configure it such that I don't have any need for a DE or X server -- I just want command line utilities and a VC (productivity and saving me from myself, all that). Anyways, I'm trying to get terminal colors working right. I haven't decided between xterm and urxvt -- honestly, whichever I can get this working with is probably the one I'll end up using, at least until I understand the issue better.

Essentially, my setup (as I understand it, so take with salt) is that on VC1 I have an xterm/urxvt 16 color terminal emulator running (also, I use Zsh, if it matters). I use Tmux for multiplexing, so both my .zshrc and .tmux.conf files in ~/ have lines that set the default terminal to (xterm/rxvt)-16color.

If I launch emacs either directly in the terminal or within Tmux and run M-x list-colors-display, it shows 16 color names. The first eight are the regular ones and they're colored correctly. However, colors 9-16 are the brights and they show up as white text on black background with no colors assigned to them.

I'm under the impression that .Xresources is where color settings go, of the form *color0: #353535 and such. All 16 colors are listed there, with values I'd like them to have. However, the eight that are colored aren't even in the right hues - they are in the striking, high-contrast color that they default to, not the more mellow theme I've downloaded for testing.

I read that you need to run xrdb -merge ~/.Xresources to make these settings come into play. However, I don't have xrdb and when I installed it I got a 'display not found' error (unsurprisingly) so I removed it.

The question then, finally, is this: what do I do to make xterm/rxvt know to (a) display all 16 colors (since I'm pretty sure the brights also have defaults, so it seems something is wrong there) and (b) to use the color (and other) settings I give it in .Xresources (or elsewhere, if applicable) without using xrdb.

Thanks for any insight!

share|improve this question
    
What are DE and VC? –  RedGrittyBrick Dec 7 '11 at 11:44
    
Sorry. DE=Desktop Environment (e.g. GNOME, KDE, etc.) and VC=Virtual Console (VC1 through (usually) 7 are the terminals you see when you press ALT+F1 through ALT+F7, so VC1 is the first (and default, without X running) virtual console). –  andhrimnir Dec 7 '11 at 21:54

1 Answer 1

up vote 1 down vote accepted

If you are using console, not an X-server, the colour settings are not controlled by ~/.Xresources. For command-line and curses apps, it is the value of $TERM and the corresponding entries in termcap and terminfo which determine how colours are displayed.

Tmux may complicate things, I haven't tried it so can't advise. I would get things working right without it first.

share|improve this answer
    
Aha. Well, that would explain it. Thanks! –  andhrimnir Dec 7 '11 at 21:55
    
Followup: I found some useful info about the terminfo database, but I'm confused because when I open one (/usr/share/terminfo/*/*) in emacs it appears as gibberish. Maybe that's how it's supposed to look, but it's unreadable by humans. Any idea why? –  andhrimnir Dec 7 '11 at 22:20
1  
@andhrimnir: Unlike termcap, the terminfo database is a binary format, not a text format. You can decode it to text and you can compile a text form to produce binary terminfo file. See man infocmp, man tic, man terminfo. Try infocmp ansi and look for colors#8, setf=\E[3%p1%dm, setb=\E[4%p1%dm –  RedGrittyBrick Dec 8 '11 at 10:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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