Imported from HermannBjorgvin/Kirby (
libs/terminal-tmux/AGENTS.md). Install upstream withnpx skills add HermannBjorgvin/Kirby --skill terminal-tmux. Copyright stays with the author.
libs/terminal-tmux — tmux session backend
Optional backend over system tmux ≥ 2.0 (is-tmux-available.ts probes and
gives a platform install hint). It knows nothing about Kirby: the caller
supplies the session prefix and the isQualified seam.
vitest.setup.tspins a scratch socket dir (TMUX_TMPDIR) and drops$TMUXbefore any spec loads;assertScratchTmuxSocketfails the run if either is lost.$TMUXnames a socket outright and beatsTMUX_TMPDIR, so a suite started inside a tmux session (how Kirby's own agents run) otherwise reaches the developer's server, where thekirby-*names are their live agents and these suites kill by name pattern.- Never
tmux kill-server. A scratch server exits with its last session. -e HOME/-e PATHper session needs tmux ≥ 3.2; a server keeps the env it was started with, and a stale server on the default socket otherwise kills every agent at launch.attach-session -f ignore-sizealso needs 3.2, above the floor.sanitize-tmux-session-name.ts:.and:become-, with a length cap. Terminal names (kirby-term-…) are shaped to pass it unchanged.