Ticket #2647 (closed defect: invalid)

Opened 12 years ago

Last modified 7 years ago

xoria256 theme broken

Reported by: god12 Owned by:
Priority: major Milestone:
Component: mc-skin Version: 4.8.0
Keywords: Cc: egmont@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Inside GNU screen with urxvtc terminal xoria256 skin is correctly shown only if TERM=xterm-256color
In case of TERM=rxvt-256color or TERM=screen-256color xoria256 is displayed as ugly bright green theme.
Note: tput colors report 256 in all 3 cases (even in mc subshell!) so all the 256 color themes are expected to be displayed exactly the same.
Note 2: in plain urxvtc (without screen) with TERM=rxvt-256color xoria256 shown just fine.

Change History

comment:1 Changed 12 years ago by god12

Entire .screenrc - just in case:

vbell off
autodetach on
startup_message off
defscrollback 10240
shell /usr/bin/zsh
encoding UTF-8
term screen-256color
hardstatus lastline "%-Lw%{= KW}%50>%n%f* %t%{-}%+Lw%<"
hardstatus off
caption always "%{rk}%?%-w%?%{kR}%n*%t%{rk}%?%+w%? %= | %{=b kr}%c:%s %Y-%m-%d "
screen mc
screen

comment:2 Changed 12 years ago by egmont

  • Cc egmont@… added

Works correctly for me. I'm using Ubuntu 10.04, how about you?

By the way, inside the screen, I have COLORTERM and TERMCAP defined which cause some confusion, e.g. mc believes the terminal doesn't support 256 colors, so I unset these two variables.

Could you please double check you have the exact same environment variables inside and outside screen?

comment:3 Changed 12 years ago by god12

Of course I have different env. variables: inside screen it's TERM=screen-256color, outside screen it is TERM=rxvt-256color.

Let me clear up potential confusion - that's what this bug report is about: 256 color theme displayed differently with different $TERM variables. It shouldn't.

Both TERM=rxvt-256color and TERM=screen-256color are 256-capable terminal emulators.
So in both cases xoria256 got to look the same way.

I hope it makes more sense now.

Should I add values of some env variables in here? Is there something else I can do to help debug this issue?

comment:4 Changed 12 years ago by egmont

Hi,

Unfortunately I don't have a clue so far what's wrong, so I'm just guessing to random directions.

Could it be that your terminfo database is incorrect? Could you please make sure that inside screen you don't have COLORTERM or TERMCAP or other related variables that would influence the behavior?

Are you sure 256 colors are working properly within screen, with other applications? Could you please test with the 256colors.pl and 256colors2.pl scripts (you can easily find them on the internet)?

Could you please try all combinations of TERM variables and inside/outside screen, e.g. TERM=screen-256color outside screen, TERM=rxvt-256color inside screen etc.? I'm wondering if it's screen itself doing something wrong, or if it depends on the TERM settings.

Can you tell if your mc is linked against ncurses or slang? (Run ldd /path/to/mc)

I'll probably follow up with more questions. It would be much easier if I could reproduce the bug, unfortunately I cannot.

Thanks a lot for your help!

comment:5 Changed 12 years ago by egmont

Oh, I could reproduce it (or something similar) on one of the computers :)

My guess is that the output of 256colors2.pl inside screen will be incorrect for you, it will use only 16 colors.

After some research, it seems that screen doesn't autodetect if the outside terminal supports 256 colors, so it approximates all the 256 colors of its inside contents to 16 colors when it sends to the outside terminal.

Please see http://www.frexx.de/xterm-256-notes/ for the three lines you need to put in your .screenrc, as well as the configure option you should specify when compiling screen.

Could you please follow those instructions and tell us if it helped?

thx!

comment:6 Changed 12 years ago by egmont

After playing with different .screenrc files and screen compile options, I'm almost sure that your screen was configured without --enable-colors256; configuring it with this option and recompiling should help. Fingers crossed.

comment:7 Changed 12 years ago by god12

Ok, let's try one more time.

WORK == xoria256 displayed properly.
DOESN'T WORK == xoria245 displayed wrong (green colors).

Setup 1 (INSIDE screen):
.screenrc from above
TERM=xterm-256color
mc -> WORK

Setup 2 (INSIDE screen):
.screenrc from above
TERM=screen-256color
mc -> DOESN'T WORK

Setup 3 (INSIDE screen):
.screenrc from above
TERM=rxvt-256color
mc -> DOESN'T WORK

Setup 4 (OUTSIDE screen):
TERM=rxvt-256color
mc -> WORK

Steps to reproduce:

  • Linux mint Katya (same as ubuntu 11.04) x86_64
  • install rxvt-unicode, ncurses-term, mc 4.8.0 (.deb from repo)
  • use .screenrc from this bug report
  • open terminal (urxvtcd) and run screen in it, then:

-- run mc (Setup 2)
-- run TERM=rxvt-256color mc (Setup 3)
-- run TERM=xterm-256color mc (Setup 1)

  • close screen and run mc (Setup 4)

mc (.deb) package from your repo is linked with libslang.so.2

Env. variables inside screen (automatically set by screen):
COLORTERM=rxvt-xpm

TERMCAP=SC|screen-256color|VT 100/ANSI X3.64 virtual terminal:\
        :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
        :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
        :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
        :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\
        :li#26:co#128:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\
        :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:im=\E[4h:ei=\E[4l:mi:\
        :IC=\E[%d@:ks=\E[?1h\E=:ke=\E[?1l\E>:vi=\E[?25l:\
        :ve=\E[34h\E[?25h:vs=\E[34l:ti=\E[?1049h:te=\E[?1049l:\
        :us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:mb=\E[5m:\
        :md=\E[1m:mr=\E[7m:me=\E[m:ms:\
        :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
        :vb=\Eg:G0:as=\E(0:ae=\E(B:\
        :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\
        :k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:\
        :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\
        :F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\
        :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\
        :kb=^H:K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:kB=\E[Z:\
        :kE=\E[8\^:kF=\E[a:kR=\E[b:*4=\E[3$:*7=\E[8$:#2=\E[7$:\
        :#3=\E[2$:#4=\E[d:%c=\E[6$:%e=\E[5$:%i=\E[c:kh=\E[1~:\
        :@1=\E[1~:kH=\E[4~:@7=\E[4~:kN=\E[6~:kP=\E[5~:kI=\E[2~:\
        :kD=\E[3~:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:

Outside screen (in urxvtcd): $COLORTERM is the same, $TERMCAP is unset.

Tips for reproducing bug:

  • make sure that 4.8.0 release used for mc binary
  • make sure screen is using proper .screenrc (mc is started automatically in first tab)
  • make sure screen uses rxvt as a terminal ($COLORTERM has to be the same both inside and outside of screen)
  • make sure to run mc with 3 different $TERM variables (TERM=xxx mc)

Please contact me right away for any additional info you need.

Last edited 12 years ago by god12 (previous) (diff)

comment:8 Changed 12 years ago by egmont

Okay, I'm getting totally lost :( But I have a feeling that something's wrong with the environment (the variables, or screen, or terminal, or terminfo database) rather than with mc. I'm not sure though.

Could you please repeat the four steps above, with unsetting COLORTERM and TERMCAP first? I believe those variable might cause some confusion.

comment:9 Changed 12 years ago by god12

Indeed.
Running mc like TERMCAP="" mc inside screen with TERM=screen-256-color-s fixed it.
Feel free to close the bug cause mc can't be blamed for screen issues.
Do you know why screen is setting TERMCAP by any chance?

comment:10 Changed 12 years ago by egmont

No clue about that, sorry.

comment:11 Changed 12 years ago by andrew_b

  • Status changed from new to closed
  • Resolution set to invalid

comment:12 Changed 7 years ago by andrew_b

  • Milestone Future Releases deleted
Note: See TracTickets for help on using tickets.