joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

euporie-console not working #29

Closed mukund109 closed 5 months ago

mukund109 commented 1 year ago

See screenshot. Not able to type anything. Euporie version 2.0.2 GNOME Terminal

image

joouha commented 1 year ago

Which version of GNOME Terminal are you using? I've just tested on GNOME Terminal 3.44.1, and it works as expected.

The text you're seeing before the prompt is an escape sequence for detecting kitty terminal graphics support, and it shouldn't be printed to the terminal - but I have seen some old VTE base terminals print it.

Do you get the same thing in other terminals? Does the cursor move if you try to type something?

jerch commented 1 year ago

@joouha Proper fingerprinting of the kitty image support is quite tricky, mainly because it relies on APC escape sequences, which are lousy to not supported by several terminals (resp. their parsers). Most of those "defect" terminals would just print things to the output, thus you might get away by doing a CPR afterwards and fixing cursor moves and falsey output manually.

joouha commented 1 year ago

Thanks @jerch - I've done some playing around, and found that sending the following sequences works quite well:

This leaves the cursor in it's original position and leaves no trace of the APC code.

@mukund109, I've implemented this in v2.0.6 - I'd appreciate it if you could test this and let me know if that fixes the issue for you.

Thanks!

jerch commented 1 year ago

@joouha Yep good idea with the cursor saving. I only see 2 minor issues linked to the whole idea (prolly not showstoppers):

joouha commented 1 year ago

Currently I run all the terminal queries before any output is generated, so should be OK on the first point.

The line wrapping I hadn't thought of, but will ensure it's disabled before probing the terminal (currently it gets disabled afterwards).

Thanks so much for your help!

joouha commented 5 months ago

I think this is fixed now, please open a new issue if you're still experiencing problems with euporie-console