feat(tui): double-press confirm on /clear and /new

Prevents accidental session loss: the first press prints
"press /clear again within 3s to confirm"; a second press inside
the window actually starts a new session. Outside the window the
gate re-arms.

Opt out with HERMES_TUI_NO_CONFIRM=1 for scripted / muscle-memory
workflows.

Refs #4069.
This commit is contained in:
Brooklyn Nicholson 2026-04-18 17:48:34 -05:00
parent 52124384de
commit 3366714ba4
4 changed files with 88 additions and 0 deletions

View file

@ -1,2 +1,5 @@
export const STARTUP_RESUME_ID = (process.env.HERMES_TUI_RESUME ?? '').trim()
export const MOUSE_TRACKING = !/^(?:1|true|yes|on)$/i.test((process.env.HERMES_TUI_DISABLE_MOUSE ?? '').trim())
export const NO_CONFIRM_DESTRUCTIVE = /^(?:1|true|yes|on)$/i.test(
(process.env.HERMES_TUI_NO_CONFIRM ?? '').trim()
)