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

"Enter" key unexpected behaviour while launching a redis shell

Đang mở
#917 4 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
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Reproduce the issue with the provided redis-cli task on Ubuntu 20.04 and inspect runner._run_body, where the problem is suspected. Compare its behavior with direct os.execve execution and review the mentioned pseudo-terminal, pty, thread handling, and fcntl interactions. Done means pressing Enter runs the Redis command instead of inserting a line break.

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

Mô tả

I think my issue is linked to https://github.com/pyinvoke/invoke/issues/733

python: 3.10.5
invoke: 2.0.0
os: Ubuntu 20.04

I want to open a redis shell, using redis-cli.

from invoke import task

@task()
def test(context):
    context.run("redis-cli", pty=True)

The problem is the "Enter" key prints a linebreak, instead of running the Redis command.

After some digging in the code, I found out the actual execution of the command in invoke is done by os.execve(shell, [shell, "-c", command], env). If I run this line in a python shell, it works as expected, the issue only happens when running the code through runner._run_body, probably because of a problem with the thread handling.

I'd be happy to help debugging / fixing this issue, but I don't have a big understanding on how pseudo-terminals / pty / fcntl work, so I'd need some help doing this.

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

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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.