-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hi! It's nice to see a library to show sixel image on terminal. But It seems that it cannot running on Windows.
It seems that because of using termios and select in cellsize.py, which is only supported on Unix. And cellsize are imported in __init__.py. So in windows, it cannot be imported.
Consider that preview version of Windows Terminal have already support sixel few months ago(In Windows Terminal Preview v1.22.2362.0). The stable version of windows terminal will also support it in future. I think it's nice to support it on Windows.
I think the fastest way to make it working on windows is to move from .cellsize import get_size from the head of __init__.py into try block in here. So that char_size can as default in (10, 20)
python-sixel/sixel/__init__.py
Lines 136 to 139 in a51ff70
| try: | |
| char_width, char_height = get_size() | |
| except Exception: | |
| char_width, char_height = (10, 20) |
By the way, I try to write Windows Implementation for get_size method.
For the size in char, we can use shutil.get_terminal_size to get in both Windows and Unix. But I have no idea how to get the size in pixels on windows.