mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-28 08:22:03 +00:00
inactivity_timeout was stored, displayed as Settings item 12, and enforced nowhere: an unattended terminal stayed unlocked indefinitely. Python's legacy TUI checks it at the top of its main loop and locks; this ports that. The main menu now measures how long the user took to answer. If that exceeds the configured timeout, the vault is locked -- the seed is dropped and re-derived through the normal relock path (password, or the session agent) -- and the keystroke that arrived after the timeout is discarded rather than acted on against a stale unlocked screen. 0 disables it, matching Python. Scope, stated plainly: like Python's, this fires when the user returns to the main menu, not via a background timer, so idling mid-submenu does not lock until they surface. A true idle-anywhere auto-lock would mean interrupting a readline mid-line and is a larger change; this matches the reference. The millisecond clock is injected through the Session (defaults to Date.now), so two tests drive it deterministically: idling past the timeout locks and demands the password a second time, and answering within it does not. Verified as a negative control -- forcing the timeout to 0 turns the locking test red. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tkj4rzKBA3uhfgk7kqjsb8