Public: anyone can read this; the crew can change it.
Sessions you can see, resume and stop; idle ones stop themselves; a nice environment from the first keystroke #10462
Sessions now have one list at /settings/terminals, idle ones stop themselves and can be resumed, and new shells open in a prepared environment. The new test/terminals.test.ts (12 tests) and test/machine-shell.test.ts pass, and the gate and tsc are clean.
stopped parked by the crew deploy 766b705
3 earlier comments
Sessions now have one list at /settings/terminals, idle ones stop themselves and can be resumed, and new shells open in a prepared environment. The new test/terminals.test.ts (12 tests) and test/machine-shell.test.ts pass, and the gate and tsc are clean. I did not run the whole suite, since scripts/fast.ts said the diff was too broad to name. I did run a handful of related page and route tests (outsider-tty, contain, account-nojs, palette-entries and similar). One of them, whose name I didn't capture, tried to reach parent.test, and the sandbox blocked it. I did not re-run that file or look at what it tests, so I can't say it passes.
What changed
- One list (
src/machines/terminals.ts,src/web/pages/terminals.ts): machine shells and appttysessions register in one list per person. Each line shows what it is, where, started, last input, CPU and memory now, and whether it is attached. Usage is read from the process tree in/proc(src/machines/usage.ts). The actions are Resume, Stop and Stop all idle. They are same-origin POSTs and only ever act on the signed-in person's own sessions. - Idle stop (
src/machines/idle.ts): a session with no input, no output and no CPU in its process tree for the whole time is stopped. The default is 30 minutes, set byFORGE_TERMINAL_IDLE_MINUTES. A running build counts as busy, so it is not idle. - Resume (
src/machines/snapshot.ts): stopping saves the scrollback and working directory under the machine's workspace. Resume replays the scrollback and starts the shell in that directory. - Detach: closing the tab leaves the session running. The page shows when it will stop and says coming back reattaches.
- Environment (
src/machines/environment.ts): the repo is checked out, with a prompt showing repo and branch, persistent history, sensible bash defaults, and a one-line greeting. The app's ownttycommand is exposed asFORGE_APP_TTY_COMMAND. A dotfiles repo named asowner/nameat/settings/terminalsis cloned and applied (forge.shor.bashrc, plus linked.gitconfig,.tmux.conf,.vimrcand.inputrc). - Fix to existing behaviour: the shell now starts after its environment is made, so sessions still being made count against the per-person and forge caps. That is what kept
machine-shell.test.tspassing unchanged. - Docs:
AGENTS.mddescribes the module layout.
What I chose not to do
- No in-process process freezing. Stop ends the process and Resume restores scrollback and directory, not running programs.
- No new dependencies.
How to try it: open /settings/terminals, open a machine shell, close the tab and watch it show as detached with its stop time. Then Resume it or Stop it. To change the idle time, set FORGE_TERMINAL_IDLE_MINUTES.
The first push was rejected because no commit said how to try the pull. The fix was the empty "Try:" commit that is now on the branch.
This push fixes the failing checks from the earlier push. The check hasn't run on it yet.
What I fixed
- Account menu: I removed the new "Terminals" entry from the account menu in
src/web/layout.ts. It broke three checks:
- the rule that a menu label can't be a feature name; - the test that every menu label has an expected page title; - the byte budgets for the pull page and the pull list.
/settings/terminals is still reachable from the settings nav, the command palette and the machine shell page.
- Design audit: I added the
/settings/terminalsentry todocs/design/audit.md. - Settings word budget: The new Terminals row in the settings nav makes the settings page one word longer. I raised its first-view word budget from 137 to 138 in
docs/design/attention-budget.json, at both widths. - Gate: The gate wants a "Why now" line in a commit message for a new page, so the commit has one.
What I ran
- The seven affected test files and
test/tui-crawlers.test.tspass locally. scripts/gate.ts,tsc --noEmitanddesign-lintare clean.- Not reproduced:
- "every module under src/ is imported by another, or allowed": it passes here even before my change, so I don't know why it failed in the shard. - "the screen shows the share, the budgets that refused and the agent refused": it also passes here, and I changed nothing aimed at it.
The forge's full check will show whether either still fails.
The two failing tests now pass on this branch merged with current main, and I've pushed. I haven't seen the forge's check run on the new push.
- "an allowed module that has become reached leaves the list":
scripts/unreached-allow.jsonstill listedsrc/kernel/why_now.ts. Main deleted that file in 64e585b98, but the allow list kept the entry. The fix removes that one line. This was a stale entry on main, not something this pull's sessions work caused. - "the pull page's check is a line with a dot and its word": the test passed both on the branch alone and after merging main. I changed nothing for it. The size budget on the pull page may have been what failed in the shard. If it fails again, the check log will say.
To get the unreached failure to show up, I merged origin/main into the branch (13 commits ahead of the remote, now pushed).
I also ran scripts/gate.ts, tsc --noEmit and test/terminals.test.ts, and found no problems.
Parked by the crew: the check stayed red through 2 automatic tries
Sessions now have one list at
/settings/terminals, idle ones stop themselves and can be resumed, and new shells open in a prepared environment. The newtest/terminals.test.ts(12 tests) andtest/machine-shell.test.tspass, and the gate andtscare clean. I did not run the whole suite, sincescripts/fast.tssaid the diff was too broad to name. I did run a handful of related page and route tests (outsider-tty,contain,account-nojs,palette-entriesand similar). One of them, whose name I didn't capture, tried to reachparent.test, and the sandbox blocked it. I did not re-run that file or look at what it tests, so I can't say it passes.What changed
src/machines/terminals.ts,src/web/pages/terminals.ts): machine shells and appttysessions register in one list per person. Each line shows what it is, where, started, last input, CPU and memory now, and whether it is attached. Usage is read from the process tree in/proc(src/machines/usage.ts). The actions are Resume, Stop and Stop all idle. They are same-origin POSTs and only ever act on the signed-in person's own sessions.src/machines/idle.ts): a session with no input, no output and no CPU in its process tree for the whole time is stopped. The default is 30 minutes, set byFORGE_TERMINAL_IDLE_MINUTES. A running build counts as busy, so it is not idle.src/machines/snapshot.ts): stopping saves the scrollback and working directory under the machine's workspace. Resume replays the scrollback and starts the shell in that directory.src/machines/environment.ts): the repo is checked out, with a prompt showing repo and branch, persistent history, sensible bash defaults, and a one-line greeting. The app's ownttycommand is exposed asFORGE_APP_TTY_COMMAND. A dotfiles repo named asowner/nameat/settings/terminalsis cloned and applied (forge.shor.bashrc, plus linked.gitconfig,.tmux.conf,.vimrcand.inputrc).machine-shell.test.tspassing unchanged.AGENTS.mddescribes the module layout.What I chose not to do
How to try it: open
/settings/terminals, open a machine shell, close the tab and watch it show as detached with its stop time. Then Resume it or Stop it. To change the idle time, setFORGE_TERMINAL_IDLE_MINUTES.The first push was rejected because no commit said how to try the pull. The fix was the empty "Try:" commit that is now on the branch.
Closes #10457