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

PromptSession as a toolbar

Open
#1,147 1 comment 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

I was wondering if it would be possible to add support for the PromptSession to be displayed as a temporary toolbar at the bottom of the screen, and erased after completion? I know technically this is possible by creating a non-fullscreen application and placing the toolbar at the bottom with a BufferControl, however I'd like to take advantage of the PromptSession shortcut for this since it already implements the rest of the "prompt" type things very well.

This use-case is implementing a temporary command input like tmux : hotkey to bring up a temporary tmux command input at the bottom of the window, which disappears after pressing enter. In the case of tmux, this uses the status line that is already there, but I'd like to be draw above the last line of the window, and then replace the original line and cursor location after completion.

I was looking at the code for PromptSession, and I believe it seems feasible, but I wanted to get seasoned contributor's opinion prior to beginning work on a pull request. Thanks!

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 the PromptSession implementation and the BufferControl-based approach described in the issue. Clarify how a temporary bottom toolbar should be displayed, dismissed after completion, and restore the prior line and cursor location; define the expected behavior and tests before implementation.

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.