The definitive guide to enable italics in tmux

13. May 2020
howto linux terminal

I'm using tmux for many years now and I would not go back. But one feature was always lacking: italics.

Vim shows HTML attributes in italic for example, but in tmux I could not use this feature. There are many guides available on the web, but all require some kind of fiddling with the terminfo db or whatnot.

But, since tmux 2.1 there is a setting to enable correct italic handling in tmux itself, see this wiki entry If you want to have a consistent 256-color support (you probably want to) you have to use tmux-256color. So, add this to your ~/.tmux.conf:

set -g default-terminal "tmux-256color"

Now I only had to change the font settings in my terminal, kitty. I'm using Fira Code (I really like the ligatures like ==, != or -->), but apparently there are no italic glyphs. Therefore I had to configure kitty to use a different font for italics. For this, only add the following to ~/.config/kitty/kitty.conf:

italic_font      Source Code Pro
bold_italic_font Source Code Pro

Change Source Code Pro to any other font you would like to use.

And thats it! I finally have italics in my setup :D