Comments (29)
It is, yes. But at some point I will implement a Windows driver.
I’ll keep this ticket open to track that.
from textual.
I see. Might be a good idea to put that in the README for now then.
from textual.
OSX and Linux only for now I'm afraid. Thee will be a Windows version at some point.
from textual.
Nope, no more curses.
from textual.
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
from textual.
I have some routines for Windows here:
https://github.com/lskbr/colorconsole/blob/master/colorconsole/win.py
from textual.
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 animation.py
, calculator.py
or even easing.py
.
It looks like WSL2 is a nice workaround for folks to try textual on Windows until it's fully supported.
Cheers!
from textual.
Thanks @mhils The Urwid code was very helpful in understanding reading input in Windows!
from textual.
Hey everyone! I've created an improved windows driver for textual
. Link to the PR!
from textual.
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
from textual.
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.
from textual.
The only dam on the way to becoming famous is this windows support
from textual.
Just FYI: This library works in Windows Terminal just fine!
from textual.
Trying to run the
textual.app
example on Windows 10 with Python 3.9.5:➜ 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 19, in <module> from .driver import Driver File "C:\CodeProjects\Python\Manim\manimvenv\lib\site-packages\textual\driver.py", line 8, in <module> import curses File "C:\Program Files\Python39\lib\curses\__init__.py", line 13, in <module> from _curses import * ModuleNotFoundError: No module named '_curses'
You can try install this https://github.com/zephyrproject-rtos/windows-curses
But a little buggy
from textual.
I've just had a look at the code and I see that there are no longer any references to curses
. Will curses be making a reappearance? (Crossing my fingers that it won't, or at least won't be a core dependency as it never seems to play well on Windows.)
from textual.
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 easing.py
, but that is already being tracked in #127 and is probably unrelated to WSL.
from textual.
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 event_loop.add_reader
. Our workaround is now to make use of tornado's AddThreadSelectorEventLoop1, which could probably be vendored if you don't need the rest of tornado.
Footnotes
from textual.
The linux libraries used are termios
and tty
(excluding curses
, there's windows port of that which works well). I can help out making a windows port, using msvcrt
and ctypes
(module replacements for windows), but don't want to do it all alone. If anyone's interested to work on it, please reply.
from textual.
The linux libraries used are
termios
andtty
(excludingcurses
, there's windows port of that which works well). I can help out making a windows port, usingmsvcrt
andctypes
(module replacements for windows), but don't want to do it all alone. If anyone's interested to work on it, please reply.
Do you have any C/C++ knowledge? You will need it and also knowledge of Win APIs
from textual.
The linux libraries used are
termios
andtty
(excludingcurses
, there's windows port of that which works well). I can help out making a windows port, usingmsvcrt
andctypes
(module replacements for windows), but don't want to do it all alone. If anyone's interested to work on it, please reply.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.
@willmcgugan Have you started work on a windows port already?
from textual.
I have done a lot of research on python CUI/TUI libraries and realized that pywin32
, ctypes
, and msvcrt
are windows modules that can help to receive input. I will keep researching into other solutions, but I would recommend making one function, at the top of the code, like:
import platform
if platform.system() == "Windows":
def readkey():
# the code
else:
def readkey():
# code
from textual.
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
from textual.
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=19This is awesome, i wanna try it as soon as possible
Same, I really want to try it out :)!
from textual.
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=19This 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).
Will has already created the windows branch here
It is awesome, but it didn't work in vscode terminal for me. Both windows terminal and command prompt work fine.
from textual.
In case you didn't know (just like me). Will has already created the windows branch here It is awesome, but it didn't work in vscode terminal for me. Both windows terminal and command prompt work fine.
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:
VS Code and Atom built-in terminals don't have much support (Atom is worse than VS Code). Windows terminal doesn't support symbols, so add a way to disable them:
Powershell and Cygwin terminals both work fine.
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 :)!
from textual.
In case you didn't know (just like me). Will has already created the windows branch here It is awesome, but it didn't work in vscode terminal for me. Both windows terminal and command prompt work fine.
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: VS Code and Atom built-in terminals don't have much support (Atom is worse than VS Code). Windows terminal doesn't support symbols, so add a way to disable them:
Powershell and Cygwin terminals both work fine.
Windows terminal (cmd and power shell) works very well for me.
It's usable in Command Prompt but the icons and color are off. It's a disaster in vscode terminal tho, font, color, icons aren't working, neither click, hover nor scrolling works.
I hope there will be a stable version for windows soon.
from textual.
Hey everyone! I've created an improved windows driver for
textual
. Link to the PR!
Great work! I'll definitely check it out
from textual.
@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.
from textual.
Did I solve your problem?
Consider sponsoring my work on Textual with a monthly donation.
Or buy me a coffee to say thanks.
from textual.
Related Issues (20)
- Dynamic bindings update HOT 1
- Problem with scrollable containers HOT 7
- SyntaxWarning for loading indicator widget HOT 3
- Potential bug with data bind HOT 3
- `TextArea` syntax highlighting for multi-language code HOT 2
- Need hints to develop with textual without constant stop/restart of app to pickup code changes
- multiple Datatable in TabbedPane:
- Missing log message group `WORKER` in Devtools documentation HOT 2
- Support document with multiple newline styles HOT 6
- DirectoryTree.path no longer reactive HOT 4
- Add a way to simulate the terminal resizing to Pilot HOT 1
- When TextArea is on a non-default screen, the text of the active line is hidden HOT 1
- `CollapsibleTitle.action_toggle` name clash HOT 1
- Cannot bind to Control+Enter or Shift+Enter for chat-like behavior in TextArea
- Provide a method to unmount and mount current Screen or Widget for python hot-reload HOT 1
- `Select` `OptionHighlighted` message leakage
- Errors in devtools on startup - possibly related to tooltip cleanup HOT 2
- `TabbedContent` styling affects child widgets HOT 1
- `TabbedContent` message mixup if `Tabs` inside a `TabPane`
- Mouse-driven focus does not behave as expected. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from textual.