Skip to content

Instantly share code, notes, and snippets.

@stuartcarnie
Created April 7, 2017 23:04
Show Gist options
  • Save stuartcarnie/818d14647cd1a42a4fbbcd689675b8c0 to your computer and use it in GitHub Desktop.
Save stuartcarnie/818d14647cd1a42a4fbbcd689675b8c0 to your computer and use it in GitHub Desktop.
One-liner to ensure italics are rendered as reverse when using tmux
mkdir $HOME/.terminfo/ && \
screen_terminfo="screen-256color" && \
infocmp "$screen_terminfo" | sed \
-e 's/^screen[^|]*|[^,]*,/screen-256color|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 && \
echo set -g default-terminal "screen-256color" | tee -a ~/.tmux.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment