# Koshi 0.5.0 — Pane commands (/docs/v0.5/cli/panes)



Inside koshi, omitted targets use the current session, tab, pane, or client.
Outside koshi, pass a target unless exactly one running session can be chosen.

<Callout>
  These verbs take `--remote <SERVER>` to act on a session on another machine.
  See [Remote commands](/docs/v0.5/cli/remote).
</Callout>

## `new-pane` [#new-pane]

Open a shell pane:

```bash
koshi new-pane
koshi new-pane --direction left
koshi new-pane --stacked
```

Main flags:

| Flag                                | Meaning                             |
| ----------------------------------- | ----------------------------------- |
| `--direction right\|down\|left\|up` | Open the new pane beside its target |
| `--stacked`                         | Add it to the target's stack        |
| `--pane <PANE_ID>`                  | Split this pane                     |
| `--tab <NAME_OR_ID>`                | Create inside this tab              |
| `--session <NAME_OR_ID>`            | Choose the session                  |
| `--client <CLIENT_ID>`              | Use this client's current view      |

`--direction` and `--stacked` are alternatives. The command prints one pane id.

A new pane's working directory and environment come from the terminal that
issued the command.

## `run` [#run]

Open a pane running one command:

```bash
koshi run -- htop
koshi run --direction down -- cargo watch -x test
```

Split flags match `new-pane`. Everything after `--` is the command and its
arguments. The command prints one pane id.

## `close-pane` [#close-pane]

```bash
koshi close-pane
koshi close-pane --pane <PANE_ID>
koshi close-pane --pane <PANE_ID> --force
```

Closing the last pane closes its tab. `--force` kills the pane's program at once
instead of asking it to stop first.

## `resize-pane` [#resize-pane]

```bash
koshi resize-pane --direction right
koshi resize-pane --direction left --size 4 --pane <PANE_ID>
koshi resize-pane --direction right --size -2
```

Directions are `right`, `down`, `left`, and `up`. A positive size grows toward
that direction; a negative size shrinks from that side.

## `focus-pane` [#focus-pane]

```bash
koshi focus-pane --pane <PANE_ID>
koshi focus-pane --pane <PANE_ID> --client <CLIENT_ID>
```

Focus belongs to a client. `--client` chooses which attached terminal moves.

## `move-pane` [#move-pane]

Swap a pane with its visible neighbor immediately, without a preview or
confirmation:

```bash
koshi move-pane --direction right
koshi move-pane --direction left --pane <PANE_ID>
```

| Flag                                | Meaning                                       |
| ----------------------------------- | --------------------------------------------- |
| `--direction right\|down\|left\|up` | Choose the visible neighbor in this direction |
| `--pane <PANE_ID>`                  | Pane to move; defaults to the focused pane    |

This command swaps panes. To move an existing pane into another tab's tiled
layout, use `place-pane`:

```bash
koshi place-pane --pane <PANE_ID> --tab <TAB> --direction right
koshi place-pane --pane <PANE_ID> --tab <TAB> --direction down --client <CLIENT_ID>
```

`--pane`, `--tab`, and `--direction` are required. `--tab` names the
destination tab by id or name. `--direction` selects the side of that tab
where the pane is inserted. `--client` is optional and selects the client
whose view sizes the destination layout.

## `scroll-pane` [#scroll-pane]

```bash
koshi scroll-pane --lines 10
koshi scroll-pane --lines -10 --pane <PANE_ID>
koshi scroll-pane --lines 5 --client <CLIENT_ID>
```

Scrolls one client's view of a pane. A positive count moves toward history; a
negative count moves toward the newest output. `--pane` defaults to the
client's focused pane, and `--client` defaults to the issuing client.

## `toggle-pane-fullscreen` [#toggle-pane-fullscreen]

```bash
koshi toggle-pane-fullscreen
koshi toggle-pane-fullscreen --client <CLIENT_ID>
```

Fill the current tab with its focused pane, or restore the prior layout. The
fullscreen view belongs to one client; `--client` names which one.

## `input` [#input]

```bash
koshi input --pane <PANE_ID> "cargo test"
koshi input --pane <PANE_ID> --no-enter "git status"
```

Text is followed by Enter unless `--no-enter` is present.
