# Terminals

> Open a shell on your workspace machine in the browser, keep it running after you close the page, and know which user, folder and limits it has.

Source: https://docs.ventgris.com/workspace/terminals

A terminal is a shell on your workspace machine, shown in the browser. Use it to run a command yourself, install a tool, log in to a CLI, inspect what the agent did, or fix something by hand. A terminal keeps running when you close the page: you find it again on the Terminals screen, from any device.

![Terminal screen with a shell in the workspace folder listing the open loops with vg loop list](https://docs.ventgris.com/img/terminals.png)

## Who can open a terminal

| Role | Terminals |
|---|---|
| `admin`, `editor` | Open, use and close terminals. The Terminals screen is in the rail |
| `member`, `viewer` | No terminal. The screen is not shown |

See [Roles](https://docs.ventgris.com/account/roles.md).

## Open a terminal

1. Click **Terminals** in the rail.
2. The first time, a terminal starts by itself. Otherwise, click **+** (**New terminal**) at the end of the tab strip.

A new terminal starts in the workspace folder (`$WORKSPACE_ROOT`). To start one in a given folder, right-click the folder in [Files](https://docs.ventgris.com/workspace/files-and-editor.md) and choose **Open a terminal here**. The folder must be inside the workspace.

When no terminal is open, the screen says "No terminal open" with a **New terminal** button.

| Message | Meaning | What to do |
|---|---|---|
| "The terminal limit of this machine is reached. Close one first." | Every terminal slot of the plan is taken, or the machine has no memory to spare | Close a terminal you no longer need |
| "The agent runner is not connected." | The part of Ventgris that starts processes is restarting or stopped | Wait a few seconds and try again. If it lasts, see [Troubleshooting](https://docs.ventgris.com/reference/troubleshooting.md) |

## Tabs

Each terminal is a tab named **Terminal 1**, **Terminal 2**, and so on, in the order they appear on the page (the numbers are not stable across visits). Click a tab to switch to it. The **x** on a tab closes that terminal. There is no split view: open another tab for a second shell.

## What survives

| Event | The terminal |
|---|---|
| You close the browser tab, or lose the network | Keeps running. Its programs go on. Come back and it is listed again |
| You open the workspace on another device | Listed there too. Click it to attach |
| You open the same terminal in a second tab or window | The newest one takes it. The other shows "This terminal is open in another tab or window." with **Use it here** and **Close** |
| Ventgris restarts on the machine (update, crash) | Keeps running and is attached again |
| The machine itself reboots | Ends, like every process |
| You type `exit`, or the shell ends | The tab shows "The shell exited (code N)." Click **Close** |
| Someone closed it elsewhere | The tab shows "This terminal no longer exists." |

When you attach again, the recent output is replayed so the screen looks as you left it. The amount replayed depends on the plan:

| Plan | Terminals at once | Output replayed on attach |
|---|---|---|
| Solo | 4 | 1 MB |
| Pro | 8 | 2 MB |
| Team | 8 | 2 MB |
| Scale | 16 | 4 MB |

The browser keeps 10,000 lines of scrollback per terminal while the page is open. See [Limits](https://docs.ventgris.com/reference/limits.md) for the other limits of each plan.

## Close a terminal

Click the **x** on its tab and confirm "Close this terminal? Its processes are stopped." The shell and everything it started receive a hang-up signal, then are killed if they do not stop.

A long command you want to keep after closing the terminal belongs in a [job](https://docs.ventgris.com/workspace/jobs.md), or in a session task of the agent.

## Terminals are shared in the workspace

The Terminals screen lists every open terminal of the workspace, including those opened by other people. Anyone with terminal access can switch to one, type in it, or close it. The [Members](https://docs.ventgris.com/workspace/members.md) screen shows how many terminals each person has open.

All terminals run as the same Linux user (below), so they also see the same files. Do not leave a terminal logged in somewhere you would not let a teammate act.

## Which user and which shell

On a workspace of the service, a terminal runs as the Linux user `vg-ai`, the same user as the AI sessions and their jobs. So the terminal and the agent share one home folder, one `PATH` and the same installed tools: a CLI the agent installs in `~/.local/bin` is in your terminal, and the reverse.

| Property | Value |
|---|---|
| Linux user | `vg-ai`. No `sudo`, no root |
| Shell | `zsh` as a login shell when the machine has it, `bash` otherwise |
| Starting folder | The workspace (`$WORKSPACE_ROOT`) |
| Home (`~`) | The home of `vg-ai`, separate from the workspace |
| Terminal type | `TERM=xterm-256color`, `COLORTERM=truecolor`, UTF-8 (`LANG=C.UTF-8`) |
| Time zone | The time zone of the workspace (`TZ`), Europe/Paris by default |

The first terminal of a workspace whose home has no zsh startup file gets a small `~/.zshrc`: history of 10,000 lines shared between terminals, completion, the `ll` alias, a prompt with the user and the folder, and `~/.local/bin` and `~/.bun/bin` first on the `PATH`. It is yours to edit: Ventgris never rewrites it.

### Environment variables

| Variable | Content |
|---|---|
| `WORKSPACE_ROOT` | Path of the workspace folder |
| `OS_ROOT` | Path of the memory folder `ventgris-os-memory` |
| `VG_TERMINAL_TOKEN` | Token that identifies this terminal to Ventgris. The `vg` command uses it to act as you, with your role |
| `VG_API_SOCK` | Socket the `vg` command talks to |
| Secrets granted to **Terminal** | Each as a variable, or a file, as set in the grant |

Secrets reach a terminal only when an admin grants them to the subject **Terminal** in [Secrets](https://docs.ventgris.com/workspace/secrets.md), in mode `env` or `file`. They are read when the terminal starts: after a value is replaced or a grant added, open a new terminal to get it. Secrets in `broker` mode never reach a terminal; use them through a [brokered action](https://docs.ventgris.com/agents/brokered-actions.md) with `vg action run`.

### Installing tools

There is no `sudo`. Install tools for the user instead:

```bash
# A binary from a release page
mkdir -p ~/.local/bin && mv ./mytool ~/.local/bin/

# Node and Python tools
npm install -g --prefix ~/.local wrangler
uv tool install ruff
```

What you install in the home survives updates and moves of the workspace. See [System](https://docs.ventgris.com/workspace/system.md) for the tools that come with the machine.

### Logging in to a model provider

Because the terminal runs as the same user as the sessions, a login made in a terminal (for example `claude login` or `codex login`) lands where the sessions look for it. Check that the provider's terms allow it before you rely on it. The usual way to give the agent a model is an API key in [Secrets](https://docs.ventgris.com/workspace/secrets.md).

## Copy, paste and keys

| Gesture | Effect |
|---|---|
| Select text, then `⌘C` | Copies the selection |
| `⌘V` | Pastes. A paste of several lines arrives as one paste, so the shell does not run each line as you go |
| Click a URL | Opens it in a new browser tab |
| `Option` (macOS) | Acts as `Meta` in the shell (`Option`-`B` moves back one word) |
| `⌘K`, `⌘1` to `⌘9` | Go to the interface (palette, screens), not to the shell |
| `Ctrl`-`C` | Sent to the shell: interrupts the running command |

On Windows and Linux, `Ctrl`-`C` and `Ctrl`-`V` go to the shell as control keys. Copy and paste with the browser menu (right click) instead.

## What is recorded

Opening and closing a terminal are written to the audit log with the account that did it. What you type and what the terminal prints are not recorded, and the output of a terminal is not masked: a person signed in sees what they type, secret values included.

> [!AGENT]
> Web terminals are for humans. Do not ask a person to paste a secret into a terminal or into a message: ask an admin to add it in Secrets and grant it. When a command must keep running after a turn, start it as a task or a job, not in a terminal. When you install a CLI for good, install it under `~/.local/bin` so the terminals and later turns find it.

## Related

- [Files and editor](https://docs.ventgris.com/workspace/files-and-editor.md)
- [Secrets](https://docs.ventgris.com/workspace/secrets.md)
- [Jobs](https://docs.ventgris.com/workspace/jobs.md)
- [The vg command](https://docs.ventgris.com/agents/vg-cli.md)
- [Limits](https://docs.ventgris.com/reference/limits.md)
