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

Is it possible to use prompt-toolkit to implement these modern CLI tools ??

Open
#843 11 comments 2 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

Prompt-toolkit supports prompt ui and fullscreen ui. But there is another partial fullscreen ui, I don't know how to implement it with prompt-toolkit.

FZF:

When I input:

cd `find . -type d | fzf --height 30% --reverse`

fzf will use stderr to render it's ui and write the result to stdout:

fzf1

As you see, with --height 30% parameter, fzf will not occupy the fullscreen and will resue only a region of current screen to display it's ui widget. When I press enter and accept a path. fzf will clear the region it used, and restore the cursor position for me:

fzf2

Then cd command get the output from fzf and take it as an argument.

Deer

Deer is a ranger like zsh plugin, it can be used as a file picker:

When I input cd <alt+k>, deer will display it's widgets under current line:

deer1

After picking a path, deer will close (clear it's ui) and restore cursor position and paste it's result:

deer2

Question

Both fzf and deer are widely used command line tools today, they are not traditional prompt program and still not traditional fullscreen application.

I really want to know is it possible to use prompt_toolkit to implement sth like fzf or deer ??

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 reviewing prompt-toolkit's existing prompt UI and fullscreen UI capabilities, then compare them with the fzf and deer behaviors described here. Determine whether partial-screen rendering, stderr/stdout interaction, clearing the used region, cursor restoration, and result insertion are supported; completion would require a documented implementation path or a clearly scoped feature.

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
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.