# Pane commands (/docs/v0.1/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.

## `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` | Place the new pane beside its target |
| `--stacked`                         | Add it to the target's stack         |
| `--pane <PANE_ID>`                  | Split this pane                      |
| `--tab <TAB>`                       | Create inside this tab               |
| `--session <SESSION>`               | Choose the session                   |
| `--client <CLIENT_ID>`              | Use this client's current view       |

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

## `run` [#run]

Open a pane running one command:

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

Placement 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` skips the normal close guard.

## `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.

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

```bash
koshi toggle-pane-fullscreen
```

Fill the current tab with its focused pane, or restore the prior layout.

## `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.
