Terminal & Dev Loop

Run interactive shells against a repository, workspace directory, or linked-server project without leaving the WebUI.

Opening a Terminal

Open the terminal from either surface:

  • Desktop — click the Terminal icon in the tool rail on the right edge of a repository, session, linked-server project, linked-server session, or Assistant page. The terminal opens in the docked side panel next to the page; click the icon again or × to close it.
  • Mobile — open the More drawer and select Terminal.

On desktop the terminal opens in the docked side panel; on mobile it opens as a dialog. If nothing is running in the selected directory, opening the panel starts a shell automatically; exited terminals do not count. Opening a specific terminal — such as a project action or worktree setup — shows that terminal instead and starts nothing extra.

Terminals are scoped to the selected repository, OpenCode workspace directory, or linked-server project directory. A terminal opened from a repo runs in that repo's path; a terminal opened from a session runs in the session's working directory; a terminal on a linked server runs on the machine that hosts that server. Switching directories shows that directory's terminals.

Tabs and Reconnect

Each terminal runs in its own tab:

  • Click + to create another terminal in the same directory.
  • Click a tab to focus it.
  • Click the × on a tab to close it. Closing a running terminal asks for confirmation, then stops the process.
  • A shell that exits successfully removes its tab, and the panel closes when it was the last terminal in the directory. A shell that exits with a non-zero code keeps its tab and output and shows exited with its exit code.

Terminals are backed by OpenCode PTYs, so they survive a browser close or reload: reopening the panel reattaches and replays the buffered output. They do not survive an OpenCode restart, which ends every PTY.

Mobile Key Bar

On mobile, the panel shows a key bar above the keyboard with keys that are awkward to reach on a soft keyboard:

  • Esc, Tab
  • Ctrl — tap to arm, then tap a key to send the modified combination; arming is consumed by the next key.
  • Arrow keys
  • |, ~, /

Runtime and Environment

Terminals run as OpenCode PTYs on the host, using the user's configured shell. They are not sandboxed: sandbox enforcement applies to agent shell tool calls, not to PTY terminals (see Agent Sandboxing).

Each terminal receives the repository's GitHub token environment (GH_TOKEN, GITHUB_TOKEN) resolved for its directory, so gh authenticates with the repo's GitHub credential. Commits made in the terminal take their author from git config: the repository's own identity when one is set, otherwise the Manager default identity (see Git identities).

git itself authenticates with the same credentials as the OpenCode server process, which the Manager configures from its saved git credentials.

On a linked server, the PTY runs on that machine with its own shell and git configuration. The Manager does not inject its repository GitHub credentials into remote terminals, so gh and git there use whatever the remote machine already has.

  • Project Actions — run and stop long-lived commands as terminals from the header menu.
  • Preview — open a dev server started in a terminal.