You are not logged in.

#1 2009-03-13 19:59:04

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

[SOLVED]256 colors in screen, problem

solved, well, more of a hack for now... but we'll see how it works out

-------------------------

so i've been on a bit of a 256 color kick as of late and it's working out well, i'm having this issue related to screen and it's killing me.

i've been all over google, i've seen the vimrc settings the screenrc term{cap,info} settings and the like.  after filling up my screenrc with entries that didn't fix the problem, i'm now widdled down to variations on the following screenrc, running screen inside a 256 color enabled terminal (rxvt-256color):

#
# screen config file; ~/.screenrc
#

### Custom changes ###
# term
term "screen-256color"
#term xterm-256color
#term rxvt-256color

# encoding
encoding UTF-8

# fix residual editor text
altscreen on

# main options
attrcolor b ".I"
defbce "on"
vbell off
startup_message off
defscrollback 5000
bufferfile "$HOME/.screen/exchange"
hardcopydir "$HOME/.screen/hardcopy"
sorendition dY
hardstatus alwayslastline
hardstatus string '%{= dW}%-Lw%{= dY}%50> %n*%f %t%{= dW}%+Lw%< %{= dW}%-=%D %m/%d/%y %C %A %1`%{-}'

here's the thing.

with "term xterm-256color", `tput colors` yields 256, mutt and vim and my prompt all show 256 colors wonderfully. 

yay happy time... EXCEPT, in both mutt ant htop (and probably others) the highlighted line doesnt go all the way across, like this:

mutt_xterm.jpg

ok that's annoying.  so i go back and change to "term screen-256color" in .screenrc.  everything /looks/ good, `echo $TERM` yields screen-256color, and EVEN `tput colors` says 256... so i know it's 256 color capable, screen knows it's 256 color capable, vim knows it's 256 color capable... try to open up mutt and i get this:

mutt_screen.jpg

but if i bypass the errors the highlighted line does in fact go all the way across the screen like it's supposed to, it also works correctly in htop with this TERM setting

WTF!

to recap, in .screenrc:
with "term xterm-256color":
* everything's great color-wise (even in mutt) but highlighted selections don't go all the way across the screen

with "term screen-256color":
* everything's great with the hilighted selections, but mutt (and only mutt) isn't aware that i'm 256 color capable

so does anyone have...

a term{cap,info} setting for screen-256color that'll make mutt aware (i thought it used the same thing as `tput colors` which returns 256 anyway, so... wtf?)

a term{cap,info} setting for xterm-256color that'll make the highlights go all the way across the screen (this may be the better fix)

any other information on this?

many thanks

also, i've tried various termcaps already (the standard google results) and also different combinations of commented/uncommented options for defbce and attrcolor b, also i've tried term screen-256color-bce (same result as screen-256color).

Last edited by brisbin33 (2009-03-13 21:11:27)

Offline

#2 2009-03-13 20:02:47

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED]256 colors in screen, problem

wow... wow

after 35 minutes crafting that beautiful post a simple `ls /usr/share/terminfo/x/` shows me xterm+256color which just so happens to work exactly as i needed

should've known that would happen

EDIT: whoops, spoke too soon xterm+256color seems to have no "clear" abilities, anyone know how to fix that?

Last edited by brisbin33 (2009-03-13 20:05:28)

Offline

#3 2009-03-13 20:41:30

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED]256 colors in screen, problem

ok, now i really solved it... we'll see if it has any negative effects though...

steps to fix:

# use "term xterm-256color" in .screenrc
> infocmp -L xterm-256color > temp.terminfo
> vim temp.terminfo
# remove "back_color_erase," from second or third line
> install -d .terminfo
> tic -o .terminfo/ temp.terminfo
> sudo mv /usr/share/terminfo/x/xterm-256color ./terminfo.backup
> sudo mv .terminfo/x/xterm-256color /usr/share/terminfo/x/xterm-256color
> ?
> profit

a few things to note.  i guess after you do `tic -o .terminfo/ term.terminfo` your system will go to ~/.terminfo before /usr/share/terminfo anyway so you should be done for your user.  after the day i've had with this issue i just wanted to install it globally to be sure it was having an effect, thus the extra steps.

seems to be working fine so far, i'm afraid when i get home and try it in a transparent terminal it'll do something goofy on me... oh well, we'll see.

/edit: typo in the code block, s/term.terminfo/temp.terminfo/

Last edited by brisbin33 (2011-01-20 16:07:06)

Offline

Board footer

Powered by FluxBB