Hans – Public Notes

Matplotlib backend for Kitty over SSH

I couldn't get kitty +kitten icat working: Terminal does not support reporting screen sizes via the TIOCGWINSZ ioctl

Workaround using tpix

wget https://github.com/jesvedberg/tpix/releases/download/v1.0.0/tpix-1.0.0-x86_64-linux.tar.gz
tar xzf tpix-1.0.0-x86_64-linux.tar.gz
mv tpix /usr/local/bin/

Install my fork of matplotlib-backend-kitty that uses tpix:

pip install git+https://github.com/HansPinckaers/matplotlib-backend-kitty-tpix.git

Recommended: put this in your bashrc (and source it):

export MPLBACKEND='module://matplotlib-backend-kitty'

Or use this in Python:

import matplotlib
matplotlib.use('module://matplotlib-backend-kitty')
import matplotlib.pyplot as plt