# Terminals

> A real shell in any session or on any machine, with splits, right next to the agent.

Source: https://sesh.codes/docs/terminals/

Sesh has two kinds of terminal. A session's terminal opens in that session's folder, under the chat. A machine's terminal opens in that machine's home folder, in its own window.

## Open a session's terminal

1. Select the session.
2. Click **Terminal** in the toolbar, or press <kbd>⌘J</kbd>.

It runs on the session's machine, in the session's folder, with the project's variables set. Press <kbd>⌘J</kbd> again to hide it; it keeps running.

Terminals opened on another device show up here too.

## Open a terminal on a machine

- Choose **File › New Terminal** (<kbd>⌥⌘T</kbd>) for this Mac.
- Choose **File › New Terminal on** and pick a machine.
- Or, in **Settings › Machines**, open the machine's **⋯** menu and choose **Open Terminal**.

Use it to sign in to things on that machine, like `gh auth login`, or to install tools a project needs.

## Split and move around

| Action | Keys |
|---|---|
| **Split Right** | <kbd>⌘D</kbd> |
| **Split Down** | <kbd>⇧⌘D</kbd> |
| **Close Pane** | <kbd>⌘W</kbd> |
| **Next Pane** / **Previous Pane** | <kbd>⌘]</kbd> / <kbd>⌘[</kbd> |
| **Move Focus** | <kbd>⌥⌘</kbd> + arrow keys |
| **Resize Split** | <kbd>⌃⌘</kbd> + arrow keys |
| **Equalize Splits** | <kbd>⌃⌘=</kbd> |
| **Zoom Pane** | <kbd>⇧⌘↩</kbd> |

These only act while a terminal has focus. Anywhere else, <kbd>⌘W</kbd> closes the window as usual. All of them are in the **Terminal** menu.

If a program like vim is still running, closing its pane asks first.

## Colors

Terminals use the colors of your theme. See [Themes](https://sesh.codes/docs/themes.md).

## On iPhone and iPad

The session's terminal opens as a sheet on iPhone, and as a split under the chat on iPad. Keys for Esc, Tab, Ctrl and the arrows sit above the keyboard. With a hardware keyboard on iPad, the shortcuts above work too.

## Good to know

- Split layouts aren't kept when Sesh restarts. The shells keep running.
- There's no shell integration yet, like jumping between commands.
