prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Draw more efficiently on Windows consoles.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
Right now, the output on a Windows console is slow, compared to what is possible. This is caused because we draw only one character at a time: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/terminal/win32_output.py#L254
A better way could be to use the WriteConsoleOutput win32 call which can write a lot of output in one go. This seems to be how Far manager (http://www.farmanager.com/) is outputting.
This needs some experiments. Probably, the abstraction that we have in renderer.py, is most optimized for vt100 terminals and doesn't make sense at all to a Windows console where we can pass one 2d array of character data in one API call.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at prompt_toolkit/terminal/win32_output.py around the character-at-a-time output and compare it with the rendering abstraction in renderer.py. Investigate whether Windows console output can be batched with the WriteConsoleOutput call while preserving the existing behavior. Done means Windows consoles render output more efficiently through an appropriate batching approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100