Skip to content

closing the trade dialog deadlocks Textual's screen teardown — App.pop_screen's do_pop waits forever on the dialog's child widgets to shut down, the event loop goes idle and stops reading input, and Ctrl‑C is dead #6578

Description

@MatthewCarven

The short version of the bug: closing the trade dialog deadlocks Textual's screen teardown — App.pop_screen's do_pop waits forever on the dialog's child widgets to shut down, the event loop goes idle and stops reading input, and Ctrl‑C is dead because raw mode turns it into an unread keystroke rather than a kill signal. Reproduces on two Textual versions, on cancel as well as buy. The four buttons in the dialog are a strong contributor.

Trader Pro.zip

docs/freeze-bug/README.md — the full write‑up: symptom, root cause, what we ruled out, how to reproduce, and two fix directions for later.
tests/test_tui_trade_dialog_freeze.py — a cross‑platform regression test (subprocess + wall‑clock timeout, so it runs on Windows — no pexpect needed). It's marked xfail today; once the dialog is fixed it'll XPASS, which is your signal to drop the marker. Verified it currently detects the freeze.
scripts/repro_trade_dialog_freeze.py — minimal repro: headless by default (Windows‑safe), or --pty to drive the real terminal app on Unix/WSL.
docs/freeze-bug/asyncio-task-dump.txt and thread-stacks.txt — the actual diagnostic captures (the stuck do_pop with every dialog widget still alive; the idle loop + live input thread).
A worklog entry summarising it, and a note that the earlier "should no longer freeze" line was wrong.

(THANKS Claude totally phoned this one in guys)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions