- Ya
- 3 Septemba 2026, 20:08 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 80d8a02
The shell was keyed on the tool window's id, and @kamo/tool-core builds those as `${toolId}-${++idCounter}` from a counter that RESETS on every page load. So the first terminal opened after a refresh was `terminal-1` again and reattached to whatever the last `terminal-1` had left running — opening a terminal would sometimes hand you half-finished work belonging to a window you had closed. That is the opposite of what was asked for: each instance opened should be a new terminal instance. The shell now has an identity of its own, minted at the click and passed as a window PROP. The tool-window snapshot persists props verbatim, so both halves hold: a newly opened window is a new shell, and a window that comes back from a refresh, a restore or a dropped connection reattaches to exactly its own. The id is random, and constrained to the character class SecurityService and the agent both enforce — tmux reads `.` and `:` as window and pane addressing, so a name carrying them names the wrong thing rather than failing. Tests pin the behaviour rather than the implementation: two clicks produce two different session ids, the id never matches the `terminal-<n>` window-id shape, and 500 successive ids are distinct and all within the accepted character class. 411 test files / 5139 tests, tsc and the production build all clean.