# Sessions (/docs/v0.1/using)



A **session** is one running koshi. It owns tabs, each tab owns a layout of
panes, and each pane owns one process with its own terminal screen and
scrollback. A **client** is a terminal attached to that session.

```
session
└── tab
    └── pane ── process, screen, scrollback
```

## Start one [#start-one]

```bash
koshi                  # one tab, one shell pane
koshi --profile dev    # tabs and panes from profile/dev.kdl
```

## See what is running [#see-what-is-running]

Every list and inspect command takes `--format table` (default) or
`--format json`.

```bash
koshi list-sessions
koshi list-tabs
koshi list-panes
koshi list-clients
```

```bash
koshi inspect session <SESSION_ID>
koshi inspect tab <TAB_ID>
koshi inspect pane <PANE_ID>
koshi inspect client <CLIENT_ID>
```

## Targeting [#targeting]

Inside koshi, a command with no target uses the current session, tab, pane, or
client. Outside koshi, give a target unless exactly one session is running — in
that case koshi picks it.

Create commands print the ids they made: `new-pane` and `run` print one pane id,
`new-tab` prints its tab id and root pane id. Those ids are what you feed back
into `--pane`, `--tab`, and `--session`.

## End one [#end-one]

```bash
koshi kill-session          # the only running session
koshi kill-session <NAME>   # a named one
```

<Callout>
  Closing the last pane in a tab closes the tab. Closing the last tab ends the
  session.
</Callout>
