bchao1 / bullet

🚅 Interactive prompts made simple. Build a prompt like stacking blocks.
https://pypi.org/project/bullet/
MIT License
3.55k stars 113 forks source link

Feature request: clear last prompt #84

Open aaronrudkin opened 2 years ago

aaronrudkin commented 2 years ago

Bullet is awesome!

Here's a feature request: It'd be nice to be able to clear the last prompt from the terminal. I have a script that basically gives the user hundreds of prompts in a row (it's a list of decisions the user has to make for automated coding/data entry). Each decision has a fairly large prompt with 8-10 options. I'd basically like to be able to clear the prompt after it's done and just write a single line for the decision that was made.

This is already fairly easy to do by importing bullet.utils.clearConsoleUp and then calling it with the appropriate number of lines. But it'd be good to add a hook into the actual construction of a given prompt (maybe in the launch() method?) to tell it to do a post-choice cleanup explicitly after the choice is made?