# Idle detection can no longer be blinded by blank terminal rows

The system decides whether a session is idle partly by reading the last few rows of its terminal. But terminal captures return PHYSICAL rows — in a tall window, the real text (like the idle prompt) can sit above a run of empty rows, so a five-row peek comes back completely blank. A blank peek doesn't match the idle patterns, so genuinely-idle sessions were counted as "active" forever — quietly inflating the "sessions are busy" signals that delay restarts and updates. A recent fix solved this same blindness inside the prompt-answering watcher; this change extracts that trimming logic into one shared helper and applies it to the idle and age checks too, so every small terminal peek now reads the last few MEANINGFUL rows. The process-level safety check (does the session have live child processes?) is untouched — a working session still can't be mistaken for idle.
