Skip to content

Terminals

Run interactive commands and keep long-running processes active while you work.

Run commands in your thread’s checkout with an interactive terminal in the desktop app. The terminal starts in that checkout, so commands run against the same files the agent uses. Delta Worktrees explains where that checkout lives.

Open a terminal

At the start of an empty line in the message composer, type !. Delta replaces the ! with an interactive terminal. A ! typed after other text remains a normal character.

Type @!, or choose Terminals in the @ picker, to open New Terminal or bring a running background terminal back inline. You can have several live terminals in a draft; ! brings back the most recently selected one.

In a thread with several projects, the picker offers New Terminal in … for each attached project instead. Choose a project to open the terminal in its checkout.

You can also choose File > Open Terminal, press Ctrl+` , or run Create Inline Terminal from the command palette.

In a thread with several projects, an expanded terminal’s header also has a Switch Terminal button. Use it to switch to another terminal or open a new one in any attached project. On macOS, press Cmd+Option+J with the terminal focused.

Type commands and use the terminal as you would use a terminal outside Delta. The terminal remains part of the thread. It runs your system shell; the Default Shell setting overrides that for terminals on your machine.

For supported shell code blocks, such as sh or bash, click Prefill Terminal to put the code into your terminal without running it. You can also place the cursor in the code block and press !. Review the input and make sure it is compatible with your shell before pressing Enter to run it.

How the agent runs commands

The agent’s own commands do not use your interactive terminal or the Default Shell setting. On macOS and Linux they run in /bin/sh. On Windows the agent has two tools: Git Bash for POSIX commands, which requires Git for Windows, and PowerShell for cmdlets, scripts, and Windows-style command-line tools.

To cap how long the agent’s foreground commands run, set Maximum Terminal Timeout (ms) in Settings > Thread > Rules. The cap applies locally and on Cloud Runners, even when the agent requests a longer timeout or none. Zero means no global limit. Changes affect new commands, not running ones, and do not limit your interactive terminals. The cap does not apply to background commands. See Rules.

On macOS and Linux, when direnv is installed and an .envrc applies to the checkout, Delta attempts to load it for interactive terminals and agent commands. Delta authorizes an .envrc that direnv has not yet allowed; one you have denied with direnv deny stays off. Because an .envrc runs code from the repository, review it before working in an unfamiliar project. If an .envrc applies but direnv is unavailable or its setup fails, the terminal still opens and agent commands still run without loading that environment.

The terminal process runs on your computer. Its commands use your checkout, tools, environment variables, and credentials. See Delta Worktrees for details.

When a terminal script changes files, Delta shows the recorded edits as a navigable diff in the thread.

Let the agent run commands in the background

The agent can start a command in the background when a later step needs it to keep running, such as a dev server, a file watcher, or a long build. The turn continues while the command runs. The command’s terminal block stays in the thread and shows how it ended: exited, stopped, timed out, or unavailable.

When a background command finishes, Delta tells the agent its exit status and last lines of output. If the thread is idle, this starts a new response. The agent can also read a command’s full output, stop it, or list the thread’s running commands.

To send a command the agent is waiting on to the background yourself, click Send to Background on its terminal block. You can also place the cursor in the block and press Cmd+Option+Z on macOS or Ctrl+Alt+Z on Linux and Windows. The agent stops waiting and the command keeps running.

Maximum Terminal Timeout (ms) does not limit background commands. A command the agent starts in the background stops only at a timeout the agent set for it, and a command you send to the background loses its timeout.

A thread can run up to 10 of the agent’s background commands at once. On a Cloud Runner, terminals close after one hour, counted from when they started, including terminals you move to the background.

What happens when you send the message

An interactive terminal starts inside your draft. Sending the message leaves a frozen snapshot in the thread and keeps the local terminal session running. Type ! again to bring back the same session, including its running process.

If the draft has several live terminals, sending snapshots the selected one and moves the others to the background.

Turn on Background Mode to keep a process running while you use another terminal in the same thread. The next ! then opens a new terminal. The sent snapshot does not update while the process continues.

Delta temporarily retains recent output from the continuing process so the agent can inspect what happened after the display froze. See Background terminal output for details about this temporary capture.

Run a terminal in the background

Before you send the message, hover over or focus the terminal block. Click the terminal icon whose tooltip says Background Mode. You can also place the cursor inside the terminal and press Cmd+Option+Z on macOS or Ctrl+Alt+Z on Linux and Windows.

Background mode is useful when a later step depends on a process that must stay running. For example, you can:

  • Start an app server, then ask the agent to test the running application.
  • Keep a file watcher or compiler in watch mode while the agent edits files.
  • Let a long-running build continue while you discuss or review other work.

You do not need background mode for one-off commands such as ls, git status, or a test command that finishes before you send the message.

Use terminals in a shared thread

Everyone in a shared thread sees a terminal block and its output as they update. The process runs on the computer where you opened it. If you opened the terminal, only you can enter commands in it. Other collaborators can watch its output.

A background process does not move or replicate when another participant sends an agent request. The next turn can interact with a development server or other local process only if its execution environment can reach that process. Seeing the terminal and its output in the shared thread does not make the process available on another machine.

Because drafts are collaborative, another participant can submit a message that contains your terminal. Sending freezes the display in that message, but your local terminal session keeps running. It remains on your computer regardless of who submits the message.

Background terminal status is shared too. Collaborators see the process in their Background Terminals control, and anyone in the thread can stop it.

Manage background terminals

While a background terminal is running, a Background Terminals control appears beside the send controls in the desktop app. Open it to see the Running Terminals menu. It lists your terminals and the agent’s background commands, identified by their live program titles, or their commands when no title is available. In a parent thread, the menu also lists its subthreads’ terminals, grouped by subthread name. Open a terminal’s submenu and choose Bring Inline where available, Scroll to Terminal, or Stop Process, or choose Stop All to stop every background terminal.

Terminal sessions depend on the Delta app that started them. Quitting Delta or removing the thread stops their processes.

What’s next

Zed Industries © 2026

TermsPrivacy