DashboardcliInkUI teardown order — 6 steps, all try…

InkUI teardown order — 6 steps, all try/catch, torndown guard prevents double-unmount

Category: architecture
Confidence: 1.00
ID: 019e6874-7d53-7c57-8cac-6867f05f5309
Project ID: c760f4f9-42b0-4ce0-b36d-6b8c38d770b2
Cross-project: No
Recalled in other projects: 1
Source session: (none)
Created: 2026-06-23 09:27:14
Updated: 2026-06-23 09:27:14

Cross-Project Recalls

ProjectHitsLast recalled
opencode-lore 2 2026-07-28

Content

InkUI.tearDown() must follow this order: (1) stop tip-rotation interval; (2) detach SIGINT listener + store.setRequestCancel(undefined); (3) instance.clear(); (4) instance.unmount(); (5) restore alternate screen \x1b[?1049l; (6) freshStdin.setRawMode(false) + .pause() + .destroy(). torndown: boolean guard prevents double-unmount (throws on some platforms). cancelRequested guard: second Ctrl+C → process.exit(130). Every step wrapped in try/catch.

Move to: