Skip to content

Use the terminal

Each Task and each Section has a terminal: a shell on the host that starts in the Task's working directory, or in the Section's directory. Use it to check the agent's work yourself, run a command, or look around the files.

Open and leave the terminal

Choose the terminal button in the Task's header, left of Task details, or press ⌘+J or Ctrl+`. The terminal takes the place of what the Task was showing and, on a wide screen, of the Task list too, so it has the whole width. The first time, Caffold starts your login shell.

A Task's terminal using the whole width of the window A Task's terminal using the whole width of the window

Choose the button or press the key again to go back to where you were. On a Section, the terminal button is the last one in the header.

Both keys work while you type and when keyboard navigation is off. Ctrl+` is for keyboards without ⌘.

Keep it running

The terminal keeps running on the host when you close the browser, change Tasks, or put your phone away. Open it again, from the same device or another, and it shows the same shell and screen, including what a running command printed in the meantime.

A terminal shows on one screen at a time. Opening it on another device moves it there, and the screen that had it says This terminal is open on another screen with Open here to take it back. A page you reload or come back to shows the terminal only while no other screen has it. The page's own connection, lost while the network dropped or the device slept, does not count as another screen.

Type into it

Everything you type goes to the shell, including Esc, so programs such as editors get it. Leave the terminal with ⌘+J or Ctrl+`. To reach the terminal's buttons from the keyboard, press ⇧+⌘+F or Ctrl+Shift+F and type a code. To scroll back, use the mouse wheel, touch, or Shift+PageUp and Shift+PageDown; a terminal keeps its last 5,000 lines.

On a phone or tablet, a row of special keys sits under the terminal: Esc, Tab, Ctrl, the arrows, Copy, and Paste. Ctrl applies to the next key you press, so Ctrl and then C stops a command. The keyboard button shows or hides the row, and each browser remembers your choice. While the on-screen keyboard is open, the terminal ends above it, so the prompt and the special key row stay in sight.

On a touch screen, press and hold a word to select it, and drag to select more. Copy copies the selection and Paste pastes into the shell. Tap the terminal to clear the selection.

The terminal on a phone, with the special key row The terminal on a phone, with the special key row

For more than one shell in a Task, run a program such as tmux inside the terminal.

Give it more height

Choose Hide header, the last button above the terminal, to give the terminal the header's height too. Its buttons then stand on the right, with Leave terminal to go back and Show header to bring the header back. Each browser remembers your choice.

A terminal without the header, its buttons in a column on the right A terminal without the header, its buttons in a column on the right

Close it

Type exit, press Ctrl+D, or choose Kill terminal, the trash button. The screen goes back to where you were before you opened the terminal. A terminal screen you reach with no terminal running, by link or after the Caffold server restarted, offers Open terminal to start a new one.

A terminal also closes when:

  • its Task moves into a worktree, so a new one starts there;
  • its Task is archived;
  • the Caffold server stops or restarts; or
  • more than 10 terminals are open. Caffold closes one that no screen shows, preferring one with no command running and the one you used longest ago.