Displaying output that is re-written on the same lines
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
No files or tests are named. Start by tracing how pyinvoke captures and prints subprocess output for the shown docker compose command, then compare its handling of carriage returns and other control characters with direct terminal output. Done means supported output is rendered with the same in-place updates without breaking existing command output behavior.
Written by the indexing model from the issue text.
Description
I'm trying to execute docker compose up -d --force-recreate --remove-orphans command via pyinvoke. The command outputs such that it updates on the same lines using control characters. But when executing via pyinvoke, it prints all the lines on separate lines.
Is it possible to have the output printed exactly as by the command?
Example:
docker-compose output (it does print logs for creating containers, but it is over-written by newer logs on the same line):
docker compose up -d --force-recreate --remove-orphans
[+] Running 3/3
⠿ Network test_app_default Created 0.1s
⠿ Container test_app-redis-1 Started 1.3s
⠿ Container test_app-web-1 Started 1.2s
same using pyinvoke:
docker compose up -d --force-recreate --remove-orphans
Network test_app_default Creating
Network test_app_default Created
Container test_app-redis-1 Creating
Container test_app-web-1 Creating
Container test_app-redis-1 Created
Container test_app-web-1 Created
Container test_app-redis-1 Starting
Container test_app-web-1 Starting
Container test_app-web-1 Started
Container test_app-redis-1 Started
Of course I could add the --no-ansi flag to docker-compose, but I was wondering if we can achieve this effect via pyinvoke as well.
Thanks!
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
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.
More from pyinvoke/invoke
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78) Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100