Rich console.input still echoed ^M after prompt_toolkit even with cooked
TTY restore. Route compact confirmation through prompt_toolkit like the
main CAI> prompt and other interactive agent flows.
Force cooked canonical TTY mode after prompt_toolkit and route /compact
confirmation through read_repl_yes_no, which restores the terminal and
strips stray carriage returns from the answer.
Restore cooked TTY state after prompt_toolkit exits so Rich console.input
and other follow-up prompts (e.g. /compact confirmation) accept Enter normally.