Displaying output that is re-written on the same lines
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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!
- 主要语言
- Python
- 星标
- 4.8k
- 派生
- 417
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pyinvoke/invoke 的其他 Issue
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78)可能已有人在做 @HarshRajSinghania 于 21 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
Runner.respond uses join leading to slowness可能已有人在做 @aryansk 于 58 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
-
Long tasks name make `invoke --list | grep a` crash with "invalid width"可能已有人在做 @cyphercodes 于 133 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
Type hints of config do not accept other values than str可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 64/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/peft#3955 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 60/100
acl-org/acl-anthology#10313 ·
维护者通常 1 天内回复
-
anime duplicate exception request-theme
难度 1/5 1 小时以内 新手友好度 82/100
LizardByte/ThemerrDB#8926 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
huggingface/transformers#49556 ·
维护者通常 1 天内回复
-
area/security bug
难度 2/5 1-3 小时 新手友好度 82/100
mozilla-ai/otari#2245 ·
维护者通常 1 天内回复