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

How do I create cascaded/nested menus

Open
#1,545 0 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

I am totally new here so this might be a naive question.

Trying to build an interactive prompt for my application and going through the documentation I could not understand if this is even possible or not. Basically, I want to implement something like cascaded menus. No GUI here, pure command line

Starting the application, there would be bunch of options. Choose and option and you now have some more options, specific to this choice only. Quit that and you are back to previous menu, the objecs created in the child menu still intact.
There could be deep nesting here

If someone has used 'ntdsutil' on Windows server, they might relate to it. Adding some pics for reference
Screenshot 2022-01-19 155300

Here, user presses ntdsutil and it opens an interactive session. They choose 'metadata cleanup` and go one level down.

Screenshot 2022-01-19 155324

Choose connections and you are taken further down. Make a connection and press q, you are back to previous menu where you can play around with those connections.

Can I achieve similar thing with prompt toolkit ?

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 prompt-toolkit documentation referenced in the issue and identify whether nested interactive command-line menus are supported. No files, tests, or entry points are named; the work would be complete when the supported approach is documented or the limitation and required feature scope are clarified.

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.