From e21f9ce4cc86789c7a814977a3d1a86be18ac38d Mon Sep 17 00:00:00 2001 From: ian-at-strix Date: Wed, 14 Oct 2026 15:55:22 -0400 Subject: [PATCH] test(resume-picker): put the pty in cbreak so the key-reader test can't hang on macOS (#1527) --- 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())