jktr / matplotlib-backend-kitty

show matplotlib plots directly in your kitty terminal
Creative Commons Zero v1.0 Universal
137 stars 16 forks source link

Make the backend work inside a Docker container #10

Open ayorgo opened 1 year ago

ayorgo commented 1 year ago

Background

Due to complex nature of my Python projects that are often deployed in the cloud and involve external non-Python dependencies I usually prefer to isolate my environments using Docker rather than through Python's native mechanism of virtual environments.

Issue

The backend doesn't really work inside a Docker container. I tried to add kitty as a dependency (which I'd try to avoid regardless) but it didn't really help.

Solution

Use kitty's native protocol instead of kitty +kitten icat to make it work both inside and outside Docker containers.

jktr commented 11 months ago

Adding native protocol support was initially planned, but I ended up never really working on it, mainly because using the icat kitten works well enough for local workflows, and because I had some concerns about how stable the image protocol would end up being. Stability has turned out fine however, and I'd definitely prefer using the native protocol preferable to shelling out to the icat kitten, particularly in a usecase like yours. So it's pretty cool that you worked on integrating this.

ayorgo commented 11 months ago

No worries. Thanks for the repo. Great portable experience with matplotlib and derivatives.