prompt-toolkit / prompt-toolkit/python-prompt-toolkit

Draw more efficiently on Windows consoles.

Open
#241 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.