Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I've got a problem, when opening vim in tmux, all fonts become in bold. my in configuration i have: set t_Co=256. Even when this being set to 8, some bolding disappears, on some keywords. I'm using Freebsd with dwm which uses uxterm. My vim color theme is "astronaut". Any clue why this happens and how to fix it?

Additional info:

  • It happens only in tmux
  • It's ok in xterm
  • echo $TERM outside tmux is "rxvt"
  • echo $TERM inside tmux is "screen"
share|improve this question
    
Does it happen outside of tmux? Does it happen in other terminal emulators? What does $ echo $TERM say in and outside of tmux? What font do you use? What encoding do you use? Is it the same everywhere? Could you add a link to that colorscheme? What does set background? say? What happens if you set it to its opposite (light vs dark)? –  romainl Jan 14 '13 at 20:03

1 Answer 1

up vote 1 down vote accepted

I had a similar problem, italics and reverse video was switched.

"Screen's terminfo description lacks italics mode and has standout mode in its place, but using the same escape sequence that urxvt uses for italics. This means applications (like vim) looking for italics will not find it and might turn to reverse in its place, while applications (like less) asking for standout will end up with italics instead of reverse. 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"

If your terminal supports 256 colors, use:

$ screen_terminfo="screen-256color"

instead of "screen". See the FAQ entry about 256 colors support for more info. Also note that tmux will still display reverse video on terminals that do not support italics."

end of this FAQ http://tmux.cvs.sourceforge.net/viewvc/tmux/tmux/FAQ

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.