Re: Italics in tmux

2011-06-09 Thread clemens fischer
On Mon-2011/04/11-09:15 Nicholas Marriott wrote
(MID <20110411071536.ga2...@yelena.nicm.ath.cx>):

> Thanks, applied. I made some minor tweaks and changed ~/.screen.conf to
> ~/.tmux.conf ;-).

Please, guys, can this be made configurable somehow?  I just updated to
SVN-2525 and, with rxvt-unicode the standout mode I'm used to doesn't
work anymore.  Instead I get bad looking italics which don't stand out.

If people are used to something, a new feature shouldn't spoil the fun.

  0 4 # echo $TERM
  screen
  
  0 4 # infocmp rxvt-unicode | g 'sitm|bce'
  am, bce, bw, ccc, eo, hs, km, mc5i, mir, msgr, npc, xenl, xon,
  sgr0=\E[m\017, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,
  
  0 4 # infocmp screen | g 'sitm|bce'

Is there a workaround to get that standout mode back?

I'm trying [1] now and woe betide you if this doesn't get me back my
standout!

[1] set-option -g terminal-overrides
"rxvt*:sitm@,bce,colors=88,*88col*:colors=88,*256col*:colors=256"

> On Sat, Apr 09, 2011 at 01:52:37PM -0300, Tiago Resende wrote:
>> OK, now this is embarrassing. This time I got it right, I swear. Sorry
>> for cluttering everyone's mailboxes!
>> 
>> FAQ
>> 
>> * vim or $otherprogram displays reverse video instead of italics, even though
>>   tmux displays italics just fine in the status line. What's wrong?
>> 
>> Screen's terminfo description lacks italics mode and has standout mode in its
>> place. To make applications aware that tmux supports italics, you'll need to
>> create its own terminfo file:
>> 
>>   $ mkdir $HOME/.terminfo/
>>   $ screen_terminfo="screen"
>>   $ infocmp "$screen_terminfo" | sed \
>>   -e 's/^screen[^|]*\|[^,]*,/screen-it|screen with italics 
>> support,/' \
>>   -e 's/smso=[^,]*,/smso=\\E[7m,/' \
>>   -e 's/rmso=[^,]*,/rmso=\\E[27m,/' \
>>   -e '$s/$/ sitm=\\E[3m, ritm=\\E[23m,/' > /tmp/screen.terminfo
>>   $ tic /tmp/screen.terminfo


clemens


--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Italics in tmux

2011-06-09 Thread Tiago Resende
On Thursday, 2011-06-09, at 22:17:43 +0200, clemens fischer wrote:
> Please, guys, can this be made configurable somehow? 
>
> Is there a workaround to get that standout mode back?

It is already configurable through terminfo. If you want italics and
standout to work properly, use what's in the FAQ [1]:

] To make applications aware that tmux supports italics and to use a proper
] escape sequence for standout, you'll need to create a new terminfo file with
] modified sgr, smso, rmso, sitm and ritm entries:
]
]   $ mkdir $HOME/.terminfo/
]   $ screen_terminfo="screen"
]   $ infocmp "$screen_terminfo" | sed \
] -e 's/^screen[^|]*|[^,]*,/screen-it|screen with italics support,/' \
] -e 's/%?%p1%t;3%/%?%p1%t;7%/' \
] -e 's/smso=[^,]*,/smso=\\E[7m,/' \
] -e 's/rmso=[^,]*,/rmso=\\E[27m,/' \
] -e '$s/$/ sitm=\\E[3m, ritm=\\E[23m,/' > /tmp/screen.terminfo
]   $ tic /tmp/screen.terminfo
]
] And tell tmux to use it in ~/.tmux.conf:
]   
]   set -g default-terminal "screen-it"

[1]: http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ

If you want reverse video *always*, then just fix screen's standout, but don't
add sitm and ritm (remove the "-e '$s/$/ sitm=\\E[3m, ritm=\\E[23m,/'" above),
or add them with \E[7m and \E[27m instead.

> If people are used to something, a new feature shouldn't spoil the fun.

The problem isn't in the feature, but in screen's terminfo, which swaps reverse
video and italics for no good reason (that I know of ;)). tmux used to
force reverse over italics because of this, and now it doesn't anymore.

>   0 4 # infocmp screen | g 'sitm|bce'

Applications aren't asking for sitm, they're asking for standout through
smso or sgr, but are getting \E[3m when they should be getting \E[7m.

Try 

$ infocmp screen | grep -o '\(smso\|sgr\)=[^,]*,'

and you'll see the problem (3s instead of 7s).


--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users