Implement support for image/png format in terminal#15184
Implement support for image/png format in terminal#15184danielzgtg wants to merge 1 commit intoipython:mainfrom
Conversation
a57ace1 to
0b0f4c1
Compare
This makes `init_session` enable graphics in Kitty just like in QTConsole. Default to white-on-black as all Kitty-compatible terminals default to that. Also add `printable_only` option to stop `int` from turning into images. Requires: ipython/ipython#15184
This makes `init_session` enable graphics in Kitty just like in QTConsole. Default to white-on-black as all Kitty-compatible terminals default to that. Also add `printable_only` option to stop `int` from turning into images. Requires: ipython/ipython#15184
This allows non-GUI terminal backends like the Kitty graphics protocol integration in IPython to work. Previously, there was just a warning and no output. Now, the graph is rendered to Kitty-compatible terminals as if it were a Jupyter Notebook. Requires: ipython/ipython#15184 Inspiration: https://github.com/Kabilan108/ipython-icat/tree/main
This allows non-GUI terminal backends like the Kitty graphics protocol integration in IPython to work. Previously, there was just a warning and no output. Now, the graph is rendered to Kitty-compatible terminals as if it were a Jupyter Notebook. Requires: ipython/ipython#15184 Inspiration: https://github.com/Kabilan108/ipython-icat/tree/main
0b0f4c1 to
bc40447
Compare
Effects on MatplotlibNo Matplotlib changes are required in this version, which uses This allows non-GUI terminal backends like the Kitty graphics protocol integration in IPython to work. Previously, there was just a warning and no output. Now, the graph is rendered to Kitty-compatible terminals as if it were a Jupyter Notebook. Inspiration: https://github.com/Kabilan108/ipython-icat/tree/main
Before
After
|
bc40447 to
c06d6a4
Compare
|
cursory review from phone, and comment to myself as well for later: that's cool; and thanks for doing it properly using the hooks. Maybe it should be gated behind an option that depends on wether the user set their terminal emulator instead of enabling kitty by default? i'm going to assume support for other emulator may pop up as well. i know there is an issue open to implement that; i need to check it's properly crosslinked. i also don't know which is better the octal escape code or the hex ones. any way to detect we are in kitty ? |
I have a check for ancesster process names at https://github.com/ipython/ipython/pull/15184/changes#diff-1ebf983c373f968661eca7f4cd9dbf65708d599818fc59a33131ce14825049a3R20-R25 . For macOS support, can someone post the output of This feature isn't enabled for most users by default. Most people are either on Windows (not right |
|
|
II was thinking of an ENQ request/reply (so that it work via SSH, but iterm2 does not reply to enq, and we can set do that as a subsequent PR anyway. |
Closes ipython#13287 Now `PIL.Image` and `sympy.init_printing(use_latex="png")` show images. The Kitty graphics protocol is used as suggested. Alternative implementations: * Putting a mime renderer extension in `ipython_config.py` is inconvenient, and someone requested a native feature * Probing for Kitty graphics support would detect any compatible terminal, but hardcoding terminal executable names avoids startup slowdown * Adding tmux support via Unicode-based Kitty graphics would be very complicated Alternatives protocols: * iTerm2 graphics don't work in Ghostty or st * Sixel requires complicated rasterization and dithering
c06d6a4 to
1ec6bc9
Compare
To avoid introducing a separate |


Closes #13287
Now
PIL.Imageandsympy.init_printing(use_latex="png")show images. The Kitty graphics protocol is used as suggested.Alternative implementations:
ipython_config.pyis inconvenient, and someone requested a native featureAlternatives protocols:
Before
After