Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem: The GUI shows a terminal beside each chat, but terminals are workspace-scoped (since #12468) -- all tabs in a directory share them -- and nothing typed there is visible to the model. To ask "why did that fail?" you have to paste output or rerun the command through the shell tool. The disconnect goes both ways: the model's own shell commands run in hidden subprocesses, so you can't watch them execute or reuse the resulting shell state.
Proposal:
- Key PTYs to the owning chat session (
sessionID on the PTY schema + connect-ticket scope, session-keyed terminal stores in the app). Each tab keeps its own shells across switches; unowned PTYs keep today's behavior.
- Capture commands via shell integration markers (OSC 133, same mechanism as VS Code) into a bounded, in-memory, per-session ring.
- Expose via a
terminal_context config: off (default -- exactly today's behavior, no capture) / tool-only / ambient / ambient-full.
- Use the same plumbing in the reverse direction: a
shell_in_terminal config: off (default -- today's isolated subprocess) / visible -- the model's shell commands are typed into the session's own terminal and output is read back through the same capture, with subprocess fallback when the terminal is absent or busy.
I have a working implementation of all four parts with tests, split-able into small PRs if the direction is acceptable. Happy to adjust the design.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem: The GUI shows a terminal beside each chat, but terminals are workspace-scoped (since #12468) -- all tabs in a directory share them -- and nothing typed there is visible to the model. To ask "why did that fail?" you have to paste output or rerun the command through the shell tool. The disconnect goes both ways: the model's own shell commands run in hidden subprocesses, so you can't watch them execute or reuse the resulting shell state.
Proposal:
sessionIDon the PTY schema + connect-ticket scope, session-keyed terminal stores in the app). Each tab keeps its own shells across switches; unowned PTYs keep today's behavior.terminal_contextconfig:off(default -- exactly today's behavior, no capture) /tool-only/ambient/ambient-full.shell_in_terminalconfig:off(default -- today's isolated subprocess) /visible-- the model's shell commands are typed into the session's own terminal and output is read back through the same capture, with subprocess fallback when the terminal is absent or busy.I have a working implementation of all four parts with tests, split-able into small PRs if the direction is acceptable. Happy to adjust the design.