Related Terminal
A Station plugin whose Terminal launcher pane opens a shell for its
Project in the bottom panel, through the SDK's related-pane capability
(useRelatedPanes) and the closed built-in terminal target
({ kind: 'terminal', binding, terminalId?, new? }; see
the terminal design and the
SDK reference). It imports only
the public SDK.
What it demonstrates
- The plugin names a binding (
project, orthread:<id>for a session of the same Project) and asks for anewshell. It never names a program or a working directory: the server resolves the shell and decides the cwd from the binding. - Station renders the terminal itself, on its own socket, as the person
viewing. A new shell needs their
terminal:operate; without it the open isnot-authorized. Opening an existingterminalIdneedsterminal:observeand is read-only withoutterminal:operate. - A binding outside the plugin's Project, or a session that does not run
there, is a
context-mismatch. revealandclosetake the handleopenreturned. Closing the pane leaves the shell running.
Install and try
- Build it with
station plugin buildin this directory, then install the directory withstation plugin install ./examples/related-terminal(or through Plugins → Install plugin). - Open a Project, choose Add pane, and open Terminal launcher.
- Choose Open a terminal. A shell opens with the Tools, below.
Verify
The host's admission and refusals are unit-tested in
src-ui/src/workspace-panes/__tests__/relatedPanesHost.test.tsx, the pane in
src-ui/src/workspace-panes/__tests__/TerminalSessionPane.test.tsx, and the
import boundary in
packages/sdk/src/__tests__/terminal-view/import-boundary.test.ts.