Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Displaying output that is re-written on the same lines

Đang mở
#907 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, docker-compose, python
Lĩnh vực
cli, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!

Ngôn ngữ chính
Python
Star
4.8k
Fork
412
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pyinvoke/invoke

Tất cả issue của pyinvoke/invoke

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.