On Thursday, 2011-08-11, at 18:43:58 +0200, Julius Plenz wrote:
> I'm using urxvt, which will set TERM=rxvt-unicode. The
> terminal (and my font) supports both italics and stand out mode. I
> verify this by entering:
> 
>     echo `tput sitm`italics`tput ritm` `tput smso`standout`tput rmso`

Same here.

> I've come to understand from reading the code, that the "italics"
> sequence will only be applied if tty_term_has(tty->term, TTYC_SITM) is
> true. By setting the terminal-overrides setting to something like
> "*:sitm@" you can explicitly set the TTYC_SITM to TTYCODE_NONE, which
> in turn will print out the standout mode sequence TTYC_SMSO instead.

This is correct.

> There are two problems I'm facing:
> 
>     1) Disabling italics won't work. Simply unsetting sitm with
>        set -g terminal-overrides "*:sitm@" will still give me italic
>        fonts.

I've just replaced my .tmux.conf with one containing that single line
and echo, vim and less all display reverse for smso (and echo displays
nothing for sitm). Your terminal-overrides is not taking effect, please
read below.

>     2) Worse yet, somehow tmux screws up the lookup of sequences.
>        Again, for testing purposes, I use the line from above to find
>        out which sequences are supposed to activate the it/so mode.
> 
>        In standard rxvt-unicode that works well. As soon as I run the
>        command from inside tmux, hoever,
> 
>        a) standout mode is now italics mode
>        b) italics mode produces "normal" font (ie. it's not recognized)

I can only reproduce this without setting terminal-overrides. Keep in
mind it will only take effect when you open a new instance of tmux or
attach the session to an urxvt terminal, so after setting it, you can
either start a new instance in a new urxvt terminal, or detach and
reattach it in the same one.

>        Now this clearly is annoying: applications explicitly asking
>        for standout get the italics sequence. Gnah.
> 
> As for problem #2, I think the cause lies here:
> 
>     $ infocmp screen | grep smso
>         smir=\E[4h, smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m,
>     $ infocmp rxvt-unicode | grep sitm
>         sgr0=\E[m\017, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,

This is exactly the same problem. Screen's terminfo sets \E[3m (italics)
for standout, when it should set \E[7m (reverse video). If your terminal
does not support italics, tmux will undo this for you, but if it does
(like urxvt does), tmux will just pass \E[3m through, as it can't know
if you want italics and your terminfo is correct, or you want reverse
and it is incorrectly asking for \E[3m.
 
> So, as I understand it, an application that's started from inside tmux
> will inherit TERM=screen. Thus, a lookup of "smso" will return the
> code that in my terminal's understanding is "sitm". -- Right?

Yeah.

> Now, I can't quite figure out where the terminal-overrides takes
> effect. Unsetting sitm has no effect. Setting smso=\e[7m (as it is
> defined by rxvt-unicode) has no effect.

terminal-overrides will override the sitm setting in rxvt-unicode's
terminfo (checked, as I said above, when you start tmux or attach in
urxvt), and will come into play when tmux checks whether
tty_term_has(tty->term, TTYC_SITM). It will return false and tmux will
then translate \E[3m to \E[7m, urxvt will understand it as reverse video
and that's what you'll see.

> This problem is *just* with rxvt-unicode; xterm, (regular) rxvt and
> others work fine.

It's the only one that sets sitm, the others will report no sitm even if
you don't set terminal-overrides.

> I'm searching for a solution to completely disable italics output and
> using just standout mode instead. Recompiling termcap/terminfo files
> is something I'd like to avoid.

terminal-overrides is the way to go. Just make sure it is already set
when urxvt's terminfo gets read by tmux.


------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to