New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Windows Driver #14
Comments
OSX and Linux only for now I'm afraid. Thee will be a Windows version at some point. |
I see. Might be a good idea to put that in the README for now then. |
You can try install this https://github.com/zephyrproject-rtos/windows-curses |
Thanks, but it still doesn't work: ➜ python -m textual.app
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\CodeProjects\Python\Manim\manimvenv\lib\site-packages\textual\app.py", line 20, in <module>
from ._linux_driver import LinuxDriver
File "C:\CodeProjects\Python\Manim\manimvenv\lib\site-packages\textual\_linux_driver.py", line 10, in <module>
import termios
ModuleNotFoundError: No module named 'termios' Looks like Textual is hardcoded to use some Unix only modules atm: https://docs.python.org/3/library/termios.html |
It is, yes. But at some point I will implement a Windows driver. I’ll keep this ticket open to track that. |
I've just had a look at the code and I see that there are no longer any references to |
Nope, no more curses. |
I have some routines for Windows here: |
For anyone interested, the repo examples seem to work pretty well on WSL2 (I'm using Ubuntu 20.04). I haven't explored any further. I am seeing the "unclosed event loop" error when I run |
I heard Will on PythonBytes talking about getting it running on Windows and decided to give textual on WSL2 a try as well. On Windows 11 and WSL2, I didn't hit any problems with It looks like WSL2 is a nice workaround for folks to try textual on Windows until it's fully supported. Cheers! |
Wsl2 is a nice workaround for the mean time but for a work perspective I would love to see it running on git bash. I'm not sure how different that is to the normal windows console. |
Please feel free to also take inspiration from @mitmproxy's urwid Windows port: urwid/urwid#448. It's not super beautiful, but at least we've shipped it and got few complaints. 😅 I don't recall if that was specific to urwid, but one particular annoyance we ran into was that Python's default event loop on Windows (ProactorEventLoop) does not support Footnotes |
The linux libraries used are |
Do you have any C/C++ knowledge? You will need it and also knowledge of Win APIs |
Yes, I have some knowledge of them. I will start work on a windows port soon, anyone here can reply to help me out. |
Thanks @mhils The Urwid code was very helpful in understanding reading input in Windows! |
I have done a lot of research on python CUI/TUI libraries and realized that import platform
if platform.system() == "Windows":
def readkey():
# the code
else:
def readkey():
# code |
The only dam on the way to becoming famous is this windows support |
Will announced on twitter that his windows solution is partially ready. Just a bit more patience :) https://twitter.com/willmcgugan/status/1484176989145554953?t=W4A0a-Oiwb_QZY5JX_TnfQ&s=19 |
This is awesome, i wanna try it as soon as possible |
Same, I really want to try it out :)! |
In case you didn't know (just like me). |
As a side note, in no way do I mean to say this package is bad — it is an awesome package, and these are just some test results I've found. I have tested on all terminals on windows, which I have. On all terminals, a weird message is printed after every press: EDIT: On windows, animations work fine, but on MacOS/Linux, a special character must be printed, code lines. Once I removed the code in the code lines, the problem was fixed. I hope a non-breaking windows port is made soon :)! |
Windows terminal (cmd and power shell) works very well for me. I hope there will be a stable version for windows soon. |
Hey everyone! I've created an improved windows driver for |
Great work! I'll definitely check it out |
Just FYI: This library works in Windows Terminal just fine! |
@ncwhale yeah, windows driver implementation has already been done. This issue should probably be closed as of now, unless there's more improvements to be made. |
Did I solve your problem? Consider sponsoring my work on Textual with a monthly donation. Or buy me a coffee to say thanks. |
Trying to run the
textual.app
example on Windows 10 with Python 3.9.5:The text was updated successfully, but these errors were encountered: