# v0.8.3

URL: https://tuios.dev/releases/v0-8-3

> tuios 0.8.3 turns the scratch terminal into a layout of its own. It adds picture-in-picture, pane history across a daemon restart, sixel images, image paste, tuios xpanes and herdr's socket API. It also brings the fixes merged since v0.8.2.

tuios 0.8.3 turns the scratch terminal into a layout of its own. It adds
picture-in-picture, pane history across a daemon restart, sixel images, image
paste, `tuios xpanes` and herdr's socket API. It also brings the fixes merged
since v0.8.2.

Before you upgrade, read
[Breaking changes and migration](https://tuios.dev/releases/v0-8-3#breaking-changes-and-migration). Every pane
now gets herdr's variables, and the scratch terminal keys changed.

The full list is at [tuios.dev/releases](https://tuios.dev/releases).

## Install

```bash
brew install tuios                     # Homebrew (macOS, Linux)
yay -S tuios-bin                       # AUR (tuios-web-bin for the web server)
nix run github:Gaurav-Gosain/tuios     # Nix
curl -fsSL https://raw.githubusercontent.com/Gaurav-Gosain/tuios/main/install.sh | bash
go install github.com/Gaurav-Gosain/tuios/cmd/tuios@v0.8.3
docker run -it --rm ghcr.io/gaurav-gosain/tuios:v0.8.3
```

A binary installed by the script or from an archive updates with
`tuios update`.

## New features

- **Scratch layouts.** The scratch terminal is a small layout of its own
  ([#303](https://github.com/Gaurav-Gosain/tuios/pull/303)). `Ctrl+B g` shows
  and hides all of its panes together.
  - Split, move, resize and zoom its panes, as on a workspace. The window
    keys act inside the box.
  - The mouse acts on the panes inside the box. A click outside the box hides
    it.
  - Each `scratch` command key has its own layout. One layout is on the
    screen at a time.
  - `tuios xpanes` from a scratch pane opens its panes in the scratch layout.
  - After a daemon restart, each layout comes back hidden, with its panes and
    their history.
- **Picture-in-picture.** `p` in window mode pins the focused pane to a
  corner of the screen as a small live view
  ([#284](https://github.com/Gaurav-Gosain/tuios/pull/284)). Press `p` again
  to unpin it.
  - The view moves to a different corner when the line you type reaches it.
  - A click on the view goes to its pane.
  - `tuios pip [window] [--off]` pins a pane from a script.
  - `[pip]` sets `width`, `height` and `corner`.
- **Pane history.** After a daemon restart or a reboot, a restored pane shows
  its old history above a dim divider
  ([#274](https://github.com/Gaurav-Gosain/tuios/pull/274)). The new shell
  starts under it.
  - `[daemon] persist_scrollback` turns this on or off. The default is
    `true`.
  - `persist_scrollback_lines` (default 1000) and `persist_scrollback_kb`
    (default 2048) set the limits for one pane.
- **Sixel images.** A pane's sixel image shows on the host, cut to the
  visible part of the pane
  ([#282](https://github.com/Gaurav-Gosain/tuios/pull/282),
  [#283](https://github.com/Gaurav-Gosain/tuios/pull/283)).
  - Popups, borders and `clear` act on the image as they act on text.
  - A host with kitty graphics and no sixel gets a kitty image. A host with
    neither shows a box.
  - A pane is told about sixel only when the host draws it. chafa, timg, lsix
    and yazi then use their text fallback on other hosts.
  - This works in daemon mode, over `tuios ssh` and in `tuios-web`.
- **Image paste.** `Ctrl+B V` pastes the image on your clipboard into the
  focused pane as a file path
  ([#306](https://github.com/Gaurav-Gosain/tuios/pull/306)).
  - tuios saves the image on the machine where the pane runs. This also works
    for a pane on a host.
  - The paste key does the same when the clipboard holds only an image.
  - tuios deletes a pasted file after one hour.
- **xpanes.** `tuios xpanes` opens one pane for each item on a new workspace,
  with multifocus on
  ([#289](https://github.com/Gaurav-Gosain/tuios/pull/289),
  [#308](https://github.com/Gaurav-Gosain/tuios/pull/308)).
  - Items come from the arguments or from stdin. `-c 'cmd {}'` runs a command
    for each item.
  - `-s` and `-ss` are speedy modes, as in tmux-xpanes. `--interval` waits
    between panes.
  - `-l` sets the layout: `tiled`, `even-horizontal` or `even-vertical`.
- **Close a workspace.** The action `close_workspace` and
  `tuios close-workspace [N]` close every pane on a workspace
  ([#308](https://github.com/Gaurav-Gosain/tuios/pull/308)). The action asks
  first.
- **Copy pipes.** `appearance.selection.copy_command` sends each yank in copy
  mode through a command
  ([#288](https://github.com/Gaurav-Gosain/tuios/pull/288)).
  - A `[[keybindings.copy_pipe]]` entry binds a copy mode key to a command.
  - The command gets the selection on stdin. Its output goes to the
    clipboard.
  - When the command fails, the clipboard gets the selection.
- **Tiling scheme.** `appearance.tiling_scheme` sets the BSP scheme of a new
  workspace ([#295](https://github.com/Gaurav-Gosain/tuios/pull/295)).
  - The values are `spiral`, `longest_side`, `alternate` and `smart_split`.
    The default is `spiral`.
  - `cycle_tiling_scheme` and the `set_tiling_scheme_*` actions change the
    scheme of the current workspace. They have no default key.
- **herdr socket API.** The tuios herdr socket answers herdr's socket API
  ([#301](https://github.com/Gaurav-Gosain/tuios/pull/301)).
  - herdr's CLI, Collie's herdr adapter and other tools for herdr work in a
    tuios pane.
  - Each method checks the grants of the pane that calls it.
- **herdr reports.** tuios accepts all of herdr's agent protocol in every
  pane ([#287](https://github.com/Gaurav-Gosain/tuios/pull/287)).
  - A Crush that you start from a shell prompt reports its state.
  - tuios accepts `pane.report_metadata` and `notification.show`.
  - An agent that crashes no longer keeps its state. The pane clears when it
    is back at its shell prompt.
  - When herdr's hook script and tuios's integration report for one agent,
    tuios's integration wins.
- **tmux shim.** The tmux shim answers the calls that Collie and other tools
  make ([#298](https://github.com/Gaurav-Gosain/tuios/pull/298)).
  - New commands: `load-buffer`, `set-buffer`, `paste-buffer`,
    `delete-buffer`, `list-clients`, `show-options` and
    `show-window-options`.
  - Control mode (`-C` and `-CC`) sends events for sessions, windows and
    panes.
  - Outside every pane, the shim serves every session.
- **Verbs for adapters.** These help a tool that drives tuios through the
  verb socket ([#302](https://github.com/Gaurav-Gosain/tuios/pull/302)).
  - `capture-pane` and `list-windows` report `history_rows` and `revision`.
  - The new verb `list-keys` lists the key names that `send-keys` accepts.
    The new key `Comma` sends a comma.
  - `subscribe` sends a `workspace-renamed` event.
  - A session keeps its id across a daemon restart.
- **Command key recipes.**
  [KEYBINDINGS.md](https://github.com/Gaurav-Gosain/tuios/blob/main/docs/KEYBINDINGS.md#command-keys)
  has five recipes for command keys
  ([#272](https://github.com/Gaurav-Gosain/tuios/pull/272)).

## Fixes

- **Focus after a close.** When you close the focused pane, the focus goes to
  the pane you used last on that workspace
  ([#286](https://github.com/Gaurav-Gosain/tuios/pull/286)).
- **Kitty Unicode placeholders.** tuios reads `a=T` with `U=1` as a virtual
  placement ([#300](https://github.com/Gaurav-Gosain/tuios/pull/300)).
  NTCharts shaders no longer flicker.
- **superfile previews.** superfile image previews show in the right place
  ([#297](https://github.com/Gaurav-Gosain/tuios/pull/297)). The fix also
  covers `kitten icat` with placeholders and hosts with 256 colours.
- **Scratch commands.** A `scratch` command key works again on the press
  after a "stopped with exit code" message
  ([#271](https://github.com/Gaurav-Gosain/tuios/pull/271)).
- **`set-agent-state`.** From inside a pane, `tuios set-agent-state` with no
  `--window` marks the pane that runs it
  ([#302](https://github.com/Gaurav-Gosain/tuios/pull/302)).
- **Screenshots.** A capture file never shows as an empty file while tuios
  writes it ([#296](https://github.com/Gaurav-Gosain/tuios/pull/296)).
- **Speed.** Panes that print many short lines use less CPU
  ([#276](https://github.com/Gaurav-Gosain/tuios/pull/276)). Each tuios
  command starts faster
  ([#275](https://github.com/Gaurav-Gosain/tuios/pull/275)).
- **tuios-web.** The `tuios-web` binary is about 260 KB smaller
  ([#277](https://github.com/Gaurav-Gosain/tuios/pull/277)).

## Breaking changes and migration

### herdr

- Every pane now gets `HERDR_ENV`, `HERDR_SOCKET_PATH`, `HERDR_PANE_ID`,
  `HERDR_WORKSPACE_ID` and `HERDR_BIN_PATH`. `[agents] herdr_protocol` now
  defaults to `always`.

- With this default, `herdr` refuses to start inside a tuios pane. To run
  herdr in a tuios pane, set this in `config.toml`:

  ```toml
  [agents]
  herdr_protocol = "agents"
  ```

- `HERDR_PANE_ID` now has herdr's form, `w<session>:p<window>`. A report with
  the window id still works.

### Scratch terminal

- Esc no longer hides the scratch terminal. Press `Ctrl+B g` to hide it.
- The close key closes a pane of the scratch terminal. When you close the
  last pane, the scratch terminal ends.
- The window keys act inside the scratch terminal. Before, a move, resize or
  tile key hid it.

### Pane history

- The daemon now saves the history of each pane in the state folder. The
  files hold what your panes printed, secrets included. To stop this, set
  `persist_scrollback = false` in `[daemon]`. The next daemon start deletes
  the saved history.

### Mixed versions

- Scratch layouts, pane history, image paste, `tuios pip` and the herdr
  socket API need a v0.8.3 daemon. To start a v0.8.3 daemon, run
  `tuios kill-server` after the upgrade. This closes every pane in every
  session, so save your work first.
- While a client of an older tuios is attached, the scratch terminal is one
  pane in a popup, as in v0.8.2.

## Contributors

Thank you to everyone who sent a pull request for this release:

- @Tim4c: focus goes to the last used pane after a close
  ([#286](https://github.com/Gaurav-Gosain/tuios/pull/286))
- @neomantra: kitty Unicode placeholder images
  ([#300](https://github.com/Gaurav-Gosain/tuios/pull/300))
