Repository navigation
feat(terminal): multiple terminal sessions in TerminalTool - #2548
Merged
Merged
Conversation
TerminalTool::with_sessions opens named tabs on demand via the session argument (max 8). Tabs share the main session's VFS but keep their own shell state, and background tabs keep running while a call waits on another. close drops a tab; an exited tab restarts on next input. Python and JS Terminal always support sessions.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | eb8dd35 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 07:03 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
TerminalTool::with_sessions(size, factory)lets an agent open named terminal tabs on demand with asessionargument (max 8). Tabs share the main session's filesystem but keep their own shell state (cwd, variables, history).watch, a server loop) and keep working in another.close: truedrops a tab. A tab whose shell exited restarts on its next input. Results list every open session with its activity.session/closeonly when sessions are enabled; plainTerminalTool::newis unchanged.Terminal.calland JSTerminal.callacceptsessionandclose; both bindings always support sessions.Why
Agents routinely need a second shell: watch a log while editing, or keep a REPL open while running commands. With one session they had to stop and restart work.
Before / After
Before: one terminal per tool; running
watch -n1 dateblocks every further call until Ctrl-C.After:
Risk
terminalfeature only (off by default). Session count is capped at 8 so a tool caller cannot grow memory without bound.Checklist
Generated by Claude Code