Stream output from a subprocess to a window?

Open
#1,076 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker-compose, python
Domain
cli

Research direction

Start with the reported subprocess.Popen and stdout use case, then inspect prompt-toolkit's window and component concepts. The requested result is for output from docker-compose up to stream into a window or component; the issue names no files or tests, so those must be located before implementation.

Written by the indexing model from the issue text.

Description

need-better-docs

I've been poking around at this for a bit now, and I'm drawing a blank as to how I'd do this.

The basic use case is - I'd like to run the command docker-compose up, and stream it's output. If I run that command alone, it just prints it's output to stdout, I'd like it to do that, but within a window/component. Later, I'd like to add a menu, and a second window to show some other bits, but right now, I'd be happy if I could just get the basic use case up and running.

From subprocess.Popen I can either obtain a BufferedReader, or I believe the FD for it's stdout to treat it like a pipe/file.

Any pointers?

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

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.

More from prompt-toolkit/python-prompt-toolkit

All issues in prompt-toolkit/python-prompt-toolkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.