1j01 / textual-paint

:art: MS Paint in your terminal.
https://pypi.org/project/textual-paint/
MIT License
936 stars 12 forks source link

technical reasons behind disturbed operation on a standard terminal? #8

Open nnako opened 1 month ago

nnako commented 1 month ago

Hi,

a couple of weeks ago, I ran into textual, checked it, and was surprised that the provided demo seems to really work on a standard (built-in) Windows terminal. This fueled my fantasy to finally be able to provide Python applications (built with pyinstaller) which use appealing graphical user interfaces while being cross-platform and avoid "real" graphics as provided e.g. by tkinter, GTK, WxPython or QT.

I thought, every application relying on textual would be able to benefit from the stable features and provide their service even on the vanilla Windows terminal. But this does not seem to be the case:

image

The drawing shows that all the icons have been messed up. And not only their appearance on the screen but also the actions connected to them don't seem to behave as expected / intended. Even though the readme text mentions the conflict with the vanilla Windows terminal, I was wondering why this would necessarily have to be the case.

So, are there any technical issues / restrictions why textual-paint currently doesn't manage to provide the ability to be used on vanilla Windows terminals?

Thanks.

1j01 commented 4 weeks ago

There are a few related issues:

However, Textual Paint does provide an option that lets you run it on the vanilla Windows console, you just have to give up the Unicode icons:

textual-paint --ascii-only-icons

Or if needed, the whole interface can be reduced to ASCII:

textual-paint --ascii-only

That said, the conhost.exe on Windows 11 does support some Unicode these days. This is what it looks like for me, by default:

Screenshot 2024-08-16 003454

It's funny, the whole "Yes" button was duplicated! This is why you should always read both buttons before clicking, I suppose, haha.

Also it's interesting that on my system, the borders are rendered as boxed question marks, whereas on your system they seem to be rendered okay (albeit with seams).

Here's what it looks like with --ascii-only:

Screenshot 2024-08-16 003746

For reference, here's what Textual Paint looks like running in the modern Windows Terminal app:

Screenshot 2024-08-16 004814