Hello,

on Sunday 06 November 2011 at 10:14, Nicholas Marriott wrote:
> Yes terminals have a default colour pair (if they have AX or op in
> terminfo anyway), it's set with \033[39m and \033[49m or sgr0.

I was expecting terminal emulators like rxvt-unicode to have a default
color pair, but I thought tmux did not have any, and was simply re-using
the default from the terminal in the client.

> \033[38;5;7m is right for rxvt-unicode-256color if tmux wants to set
> colour 7 (it's the same as tput setaf 7|cat -v) but tmux should not be
> setting colour 7, it should be setting the default colour after \033[m
> (either using sgr0 or \033[39m).

I don't really understand from where this 7 comes, unless it's some kind
of default color pair internal to tmux, but then how can such a value be
set?

> But this works for me fine with rxvt-unicode-256color, can you send me
> the output of infocmp -x in rxvt-unicode?

As I said in my previous e-mail, there are two ncurses with two
different databases, and it messes things up. For example
`tput setaf 7 | cat -v` outputs "^[[23m", but that's because tput is
using the terminfo database from port ncurses, while tmux uses
(probably) termcap database from base ncurses, which contains
:AF=\E[38;5;%dm:

Here are the relevant termcap entries (I hope it's not too spamy):

rxvt-mono|rxvt terminal emulator (monochrome) (X Window System):\
        :am:eo:km:mi:ms:xn:xo:\
        :co#80:it#8:li#24:\
        :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
        :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
        :RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:cd=\E[J:\
        :ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\
        :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ei=\E[4l:\
        :ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:im=\E[4h:\
        :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
        :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\
        :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
        :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:ke=\E>:\
        :kh=\E[7~:@7=\E[8~:kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:le=^H:mb=\E[5m:\
        :md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:\
        :se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
        :te=\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:us=\E[4m:\
        :vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:

rxvt-unicode|rxvt-unicode terminal (X Window System):\
        :SF=\E[%dS:SR=\E[%dT:bw:ec=\E[%dX:kb=\177:kd=\EOB:ke=\E[?1l\E>:\
        :kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:lm#0:te=\E[r\E[?1049l:\
        :ti=\E[?1049h:tc=rxvt-mono:

rxvt-256color|rxvt terminal emulator with 256 colors:\
        :Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode:

rxvt-unicode-256color|rxvt-unicode disambiguation:\
        :so=\E[7m:se=\E[27m:ZH=\E[3m:ZR=\E[23m:\
        :tc=rxvt-256color:

The last entry is from my $HOME/.termcap, while the rest comes from
system /usr/share/misc/termcap (symlinked as /etc/termcap). Because the
changes to $HOME/.termcap were reflected immediately, I think there is
no compilation needed.

The main reason for using the last entry was that in port ncurses
database, rxvt-256color refers to 256 color version of rxvt (it makes
sense) and not of rxvt-unicode. So at first it was only an alias, and
when I was tmux FAQ about reverse-video versus italics with
rxvt-unicode, I added so/se and ZH/ZR capabilities.

Now if you're asking for `infocmp` output, I guess you're more familiar
with terminfo format than termcap, so I will try to merge the above
entries and convert them. Since I'm not completely certain I'm doing it
right, and whether port ncurses tool interprets termcap exactly like
base ncurses libraries, you should probably consider the above termcap
much more reliable than the below terminfo.

rxvt-unicode-256color|rxvt-unicode disambiguation,
        am, bw, eo, km, mir, msgr, xenl, xon,
        colors#256, cols#80, it#8, lines#24, lm#0,
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
        clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
        dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
        flash=\E[?5h\E[?5l, home=\E[H, ht=^I, hts=\EH,
        ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J,
        indn=\E[%p1%dS, is1=\E[?47l\E=\E[?1l,
        is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
        ka1=\EOw, ka3=\EOy, kb2=\EOu, kbs=\177, kc1=\EOq, kc3=\EOs,
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
        kdch1=\E[3~, kend=\E[8~, kf0=\E[21~, kf1=\E[11~,
        kf2=\E[12~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~,
        kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[7~,
        kich1=\E[2~, knp=\E[6~, kpp=\E[5~, nel=^M^J, rc=\E8,
        rev=\E[7m, ri=\EM, rin=\E[%p1%dT, ritm=\E[23m, rmacs=\E(B,
        rmcup=\E[r\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>,
        rmso=\E[27m, rmul=\E[24m, sc=\E7, setab=\E[48;5;%p1%dm,
        setaf=\E[38;5;%p1%dm, sgr0=\E[m\017, sitm=\E[3m,
        smacs=\E(0, smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h\E=,
        smso=\E[7m, smul=\E[4m, tbc=\E[3g,

By the way, I'm surprised by the number of differences between this and
the (irrelevant for now) terminfo entry in ported ncurses. However I
have no idea how to test which one is the most accurate.


Thanks for your help,
Natacha Porté

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to