# Koshi 0.6.0 — Floating panes (/docs/v0.6/using/floating-panes)



A floating pane sits above the tiled panes and belongs to no tab, so it stays
in view when you switch tabs. A session holds at most 12 floating panes.

The pane, its program, and its scrollback belong to the session. Where it sits,
whether it is pinned, and whether it is minimized belong to each attached
terminal: moving or minimizing a floating pane on your screen leaves every
other terminal's screen as it was.

## Open and float [#open-and-float]

| Keys                           | Result                                                 |
| ------------------------------ | ------------------------------------------------------ |
| <kbd>\<C-p></kbd> <kbd>f</kbd> | Open a shell in a new floating pane                    |
| <kbd>\<C-p></kbd> <kbd>u</kbd> | Float the focused pane, or dock it back when it floats |

<kbd>\<C-p></kbd> <kbd>f</kbd> opens the pane at 60% of each axis of the
pane area. The shell starts in the working directory of the focused pane. Your
terminal shows the new pane and gives it your keys; every other terminal holds
it minimized.

<kbd>\<C-p></kbd> <kbd>u</kbd> on a tiled or stacked pane floats it where
you see it, keeping its program and scrollback, its top-left cell, and its
size, each axis cut to 90% of the smallest pane area of the attached
terminals. The other panes of its tab fill the space. If it was the only pane
of its tab, the tab closes.

<kbd>\<C-p></kbd> <kbd>u</kbd> on a floating pane docks it into your
active tab, beside the smallest pane, group, or tab span under the pane's
center cell, on the edge nearest that cell. A tab with no room refuses with
`tab <name> has no room for another pane`.

The last tiled pane of the session's only tab cannot float, and a 13th floating
pane is refused with `a session holds at most 12 floating panes`.

From a shell:

```bash
koshi new-pane --floating
koshi run --floating --cols 80 --rows 60% -- htop
koshi undock-pane --pane <PANE_ID>
koshi dock-pane --pane <PANE_ID> --tab <TAB> --direction right
```

See [Pane commands](/docs/v0.6/cli/panes#floating-panes) for every flag.

## Focus [#focus]

| Keys                                   | Result                                    |
| -------------------------------------- | ----------------------------------------- |
| <kbd>\<C-p></kbd> <kbd>Tab</kbd>       | Show and focus the next floating pane     |
| <kbd>\<C-p></kbd> <kbd>Shift+Tab</kbd> | Show and focus the previous floating pane |

The steps follow the order the panes became floating and wrap at the ends. A
minimized pane is shown again. From a tiled pane, <kbd>Tab</kbd> lands on the
first floating pane and <kbd>Shift+Tab</kbd> on the last. The prefix stays
open, so each further <kbd>Tab</kbd> takes one more step; <kbd>Esc</kbd> closes
it.

## The titlebar [#the-titlebar]

Each floating pane has a titlebar row:

| Part             | Result                               |
| ---------------- | ------------------------------------ |
| `⣿⣿` grab handle | Drag to move the pane on your screen |
| `[ ]`            | Pin the pane at its cell             |
| `[⚪]`            | Unpin the pane                       |
| `–`              | Minimize the pane                    |
| `✕`              | Close the pane                       |

A pinned pane does not move, and resizes from its right and bottom borders
only. <kbd>\<C-p></kbd> <kbd>i</kbd> pins or unpins the focused floating
pane.

## Mouse [#mouse]

A floating pane takes the mouse on every cell it covers. A wheel notch on any
of those cells, the titlebar and border included, scrolls that pane.

* Drag the grab handle to move the pane. It stays inside the pane area, and the
  move is sent when you release. <kbd>Esc</kbd> during the drag cancels it.
* Drag a border to resize the pane, up to the edge of the pane area on that
  side. A drag on a corner moves the two borders that meet there.
* A press on the titlebar, the grab handle, or the border focuses the pane and
  shows it above your other floating panes.

## Move with the keyboard [#move-with-the-keyboard]

<kbd>\<C-p></kbd> <kbd>m</kbd> opens a chooser when your terminal shows a
floating pane you did not pin. <kbd>f</kbd> opens floating pane move mode
(`MOVE FLOAT`), and <kbd>t</kbd> the tiled pane move preview.

| Keys                                  | Result                                   |
| ------------------------------------- | ---------------------------------------- |
| <kbd>←↓↑→</kbd>                       | Move the selected pane one cell          |
| <kbd>Tab</kbd> / <kbd>Shift+Tab</kbd> | Select the next / previous floating pane |
| <kbd>Enter</kbd>                      | Send the move                            |
| <kbd>Esc</kbd>                        | Discard the move and leave the mode      |

The mode selects the focused floating pane, or the front-most one when a tiled
pane is focused, and never a pinned or minimized pane. A drag on a pane's
content or grab handle also moves it. By default the mode stays open after a
move; `stay-in-pane-placement-mode-after-placement #false` closes it.

## The tray [#the-tray]

The tab bar shows the tray button `⧉`. <kbd>\<C-p></kbd> <kbd>w</kbd> or a
click on it opens the tray (`TRAY`), which lists every floating pane of the
session as a numbered tile, in the order the panes became floating, then a
`+ new` tile.

A lit tile is a pane your terminal shows; a gray tile is one you minimized.

| Keys                                             | Result                                                                                            |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| <kbd>←↓↑→</kbd>                                  | Select a tile                                                                                     |
| <kbd>Enter</kbd>                                 | Minimize a lit tile's pane, show and focus a gray tile's pane, or open a floating pane on `+ new` |
| <kbd>a</kbd>                                     | Minimize every floating pane you show, or show them all when none shows                           |
| <kbd>Esc</kbd> or <kbd>\<C-p></kbd> <kbd>w</kbd> | Close the tray                                                                                    |

A click on a tile does what Enter does. The tray's titlebar shows the full
title of the selected tile and a `minimize all` or `restore all` label. A click
outside the tray closes it. Opening, minimizing, and restoring change only your
screen.

## Minimize and restore [#minimize-and-restore]

A minimized pane keeps its program running. Show it again with
<kbd>\<C-p></kbd> <kbd>Tab</kbd>, from the tray, or from a shell:

```bash
koshi minimize-pane --pane <PANE_ID>
koshi restore-pane --all
```

## Other actions [#other-actions]

These actions have no default key and can be bound in `keybinding.kdl` or run
with `koshi actions run`:

| Action                                    | Result                                    |
| ----------------------------------------- | ----------------------------------------- |
| `core:undock-pane`                        | Float the focused pane                    |
| `core:pin-pane`, `core:unpin-pane`        | Pin or unpin the focused floating pane    |
| `core:minimize-pane`                      | Minimize the focused floating pane        |
| `core:minimize-all-floating-panes`        | Minimize every floating pane you show     |
| `core:restore-all-floating-panes`         | Show every floating pane you minimized    |
| `core:toggle-minimize-all-floating-panes` | Minimize all, or show all when none shows |

## Small terminals [#small-terminals]

A terminal whose pane area is smaller than `5x6`, or that shows
`Terminal too small — enlarge window`, cannot draw floating panes. It holds
every floating pane minimized, and floating-pane focus keys are refused with
`no floating pane can be drawn on this client`.
