# Tabs (/docs/v0.4/using/tabs)



A tab owns one pane layout. Each client chooses which tab it is viewing.

## Create and close [#create-and-close]

| Keys                           | Result                           |
| ------------------------------ | -------------------------------- |
| <kbd>\<C-t></kbd> <kbd>n</kbd> | Create a tab with one shell pane |
| <kbd>\<C-t></kbd> <kbd>x</kbd> | Close the current tab            |

```bash
koshi new-tab
koshi new-tab --client <CLIENT_ID>
koshi close-tab --tab <NAME_OR_ID>
koshi close-tab --tab <NAME_OR_ID> --force
```

`new-tab` prints the new tab id, then its root pane id. `--client` chooses the
attached terminal that switches onto the new tab. Inside koshi, an omitted
session means the current one. Outside koshi, pass `--session` unless exactly
one session is running.

Closing a tab closes every pane and process inside it. Closing the last tab
ends the session.

## Name or id [#name-or-id]

`--tab` takes the tab's generated name or its printed `tab-<uuid>` id. A value
that reads as an id is used as an id and never looked up as a name. A name that
several tabs share is refused, and the error lists every matching id.

## Switch [#switch]

| Keys                 | Result       |
| -------------------- | ------------ |
| <kbd>Tab</kbd>       | Next tab     |
| <kbd>Shift+Tab</kbd> | Previous tab |

```bash
koshi next-tab
koshi previous-tab
koshi focus-tab --index 0
koshi focus-tab --tab <NAME_OR_ID>
```

Tab indexes are zero-based. Focus is per client; pass `--client` when choosing
which attached terminal to move.

## Reorder [#reorder]

```bash
koshi move-tab --tab <NAME_OR_ID> --index 0
```

`move-tab` changes session order without changing the tab's pane layout. The
order belongs to the session, so every attached terminal sees the move.
