prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Newb Issue: Realtime output
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to create a fullscreen CLI for some scripts. I have a fullscreen application that is an input text field and two output text fields.
The first output text field is a "control" output window, for stuff like information regarding which scripts are running, their progress, etc..
The second output text field is a true "output" text field which returns the results from the script.
My issue is that I want to be able to make realtime changes to the "control" output window, to give the user feedback on what step the is being done to launch the script.
Basically it looks like this at the moment...
def do_command(args):
print_to_control("Preping for command")
#prep for command
print_to_control("Executing command")
output = subprocess.output_check(cmd)
print_to_output(ouput)
return
def print_to control(string):
new_text = control_window.text + string
control_window.document = Document(text=new_text)
return
Whenever it runs, it completes the subprocess before updating the command window. What I want is for those prints to occur immediately whenever it occurs in the code.
I've just started using python prompt toolkit so maybe there is an easy way to solve it, but any assistance on this would be great
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named. Start by reviewing the prompt-toolkit application and event-loop entry points, then trace do_command, print_to_control, and the blocking subprocess.output_check call. The issue does not define a specific implementation or testable completion condition.
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