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

Slightly more synchronous completer?

Open
#497 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

Is it possible to make the completer slightly more synchronous. I appreciate that it doesn't block, but sometimes I like to type tab and then more text, or enter, for cases where I know the completion is unique, so that it will fill in the common part automatically. But if you type any text before the completion code finishes, the completion is cancelled and doesn't happen.

I'm probably asking two contradictory things, having it be both nonblocking and synchronous. But maybe instead of an immediate cancel it could use a timeout, so that it could block for a fraction of a second (the actual ideal time would need to be found experimentally), but then be nonblocking after that to avoid issues where the completer hangs.

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 by locating the completer's cancellation and input-handling entry points, then reproduce the case where typing more text or pressing Enter cancels an unfinished completion. Compare possible timeout behavior with the current nonblocking behavior; done requires a documented, tested choice that preserves responsiveness while allowing the intended completion to finish.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.