From 160a7fa4f31288fe80808f3aa626a13064a05f8c Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 14 Oct 2026 15:52:53 -0400 Subject: [PATCH] test(resume-picker): put the pty in cbreak so the key-reader test can't hang on macOS --- tests/test_resume_picker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_resume_picker.py b/tests/test_resume_picker.py index 31bbf9ec..6fab9f6b 100644 --- a/tests/test_resume_picker.py +++ b/tests/test_resume_picker.py @@ -263,7 +263,11 @@ def test_narrow_terminals_never_wrap_a_row() -> None: @pytest.mark.skipif(sys.platform == "win32", reason="POSIX key reader") def test_posix_key_reader_handles_multibyte_and_arrows() -> None: + tty = pytest.importorskip("tty") master, slave = os.openpty() + # Without this the pty echoes the writes into an output queue nobody reads, + # and read_raw_key's TCSADRAIN restore blocks forever on macOS. + tty.setcbreak(slave) try: with os.fdopen(slave, "r+b", buffering=0) as stream: os.write(master, "\u00e9".encode())