When I search in, for example, man ls
while in a tmux
session, the search strings don't appear highlighted - the page jumps down so that the search string is on the top line of the buffer, as expected, but it's not highlighted.
Doing the same thing in the same shell while not in a tmux
session results in highlighted search strings.
I have no idea where to start looking to solve this. Any hints are appreciated.
This thread is a few years old but is still the one that comes up as the best search result, so I'm answering with what finally worked for me. This is based off of tmux FAQ.
...but the instructions aren't completely clear on when or where to substitute the -256color string. I use gnome-terminal (v 3.16.2) with tmux, and this worked for me:
And tell tmux to use it in ~/.tmux.conf:
Note: I tried it once without the -256color and since that didn't work (still seeing italics instead of highlighting), I had to delete everything under the .terminfo dir (another dir called 's') before the infocmp would work.
Based on Less Colors For Man Pages by
Gen2ly
, here is my man page and how to do it:Preview
This is a shell, not a web page !
How to
Edit your
~/.bashrc
~/.zshrc
, etc. to add :Reload your config and try a man page search :
Fixed it. The problem is to do with the way that the
screen
$TERM
handles italics. From thetmux
FAQ:This matches my problem exactly. The
$PAGER
used byman
isless
by default - basically,man
usesless
to show the contents of the manual pages. In my case,less
wasn't highlighting text, just showing regular text.The reason for this happening:
The solution is to make a new
terminfo
file fortmux
, which lets it know that italics are supported. The solution's outlined in the (at time of writing) very, very bottom of thetmux
FAQ.After creating the new
terminfo
file, intmux
:C-b :source-file /absolute/path/to/.tmux.conf
(from this SuperUser question) - this should maketmux
reload the.tmux.conf
file. However, this didn't work for me, and the changes only applied after restarting thetmux
server (close alltmux
sessions, then re-open them).