ProcessTerminal.start() can parse the startup OSC 11 response before
InteractiveMode.init() registers its onAppearanceChange callback (init
awaits hooks/mode/draft restore between ui.start() and subscribing).
The dedup in #handleOsc11Response then suppresses the value forever and
theme auto-detection stays on the dark fallback despite a light
terminal. Replay the already-detected appearance to subscribers that
register after detection.
Adopted from PR #4883; hardened the test to stop the terminal before
asserting so a failure cannot leak a live terminal into later tests.
Fixes#4731