# v0.5.0

URL: https://tuios.dev/releases/v0-5-0

> Persistent sessions backed by a daemon, multi-client attach over SSH, a remote control CLI, and BSP tiling with manual splits.

30 commits between v0.4.0 and v0.5.0, released on 25 December 2025. tuios now
runs as a session you attach to:

- A daemon keeps sessions alive when the client disconnects.
- More than one client can attach to one session.
- New CLI commands drive a running session from outside.
- BSP tiling, with manual splits.

Underneath, the code moved to the charm.land packages for Bubble Tea v2.

## Breaking changes

- **Import paths.** If you build on tuios as a library, the Charm packages
  moved from `github.com/charmbracelet` to `charm.land`.
- **Session state.** State from before v0.5.0 does not carry over to the new
  daemon format.
- **CLI.** `tuios new` and `tuios attach` take the session name as a
  positional argument. The flags that did the same are gone.

## Sessions that survive a disconnect

```bash
tuios new work      # create a session backed by a daemon
tuios ls            # list sessions
tuios attach work   # attach again
```

Detach, close the terminal, or lose the SSH connection, and the session keeps
running. Attaching again brings back windows, layouts, BSP trees, screen
contents and scrollback. A session lasts as long as the daemon process. The
daemon is started in-process.

This works on Windows too. The daemon uses Unix sockets and ConPTY, which
Windows has had since Windows 10 build 17063.

In daemon mode there are two VT emulators, the daemon's and the client's, and
both answered terminal queries. The extra answers printed as text, such as
`^[[?62;1;6;9;15;18;22c` on reattach. The first fix dropped every reply, which
made fish wait two seconds at startup for a Device Attributes reply that never
came. What shipped: the daemon's emulator answers queries, and the client's
drops its copies, so programs get their replies and nothing prints twice.

*[An interactive figure goes here. Open the page to use it.](https://tuios.dev/releases/v0-5-0)*

## More than one client

- Several clients can attach to one session and see the same thing. Focus,
  mode changes, workspace switches and window lifecycle sync in real time.
- The session renders at the smallest attached client's size, so nobody gets a
  cropped frame.
- The SSH server maps the username to a session, so `ssh -p 2222 work@host`
  attaches to `work`. Connecting without a name shows a session picker.

A typical use is pair debugging: one person creates the session and the other
attaches from another machine.

Most of the fixes in this release made this stable. Client teardown, daemon
goroutines and window callbacks had races that only show with two clients on
one state. They got `sync.Once` on close, WaitGroup tracking, an atomic flag, a
five-second shutdown timeout, and tests under the race detector.

## A CLI for a running session

- `tuios send-keys` sends keys to tuios for window management, or with
  `--literal --raw` straight to the focused PTY, one character at a time.
- `tuios run-command` runs any tape command by name.
- `tuios set-config` changes configuration at runtime.
- `tuios tape exec` runs a tape file against the session.
- `tuios list-windows`, `tuios get-window` and `tuios session-info` read daemon
  state with no TUI attached, with `--json` for scripts.
- `tuios logs` tails the daemon.

All of them have shell completion.

## BSP tiling

A binary space partitioning layout. New windows follow a spiral, alternating
vertical and horizontal splits. When the spiral guesses wrong:

- `Ctrl+B -` and `Ctrl+B |` split explicitly.
- `Ctrl+B R` rotates the split at the focused window.
- Preselection chooses where the next window lands, and the dock shows the
  direction of the next split.
- An equalize command resets every ratio to 50/50.

Trees are kept per workspace and saved in daemon state, so a layout survives a
detach and reattach.

## Snapping, appearance and animations

- Dragging a window to a screen edge snaps it: top centre for fullscreen, the
  left or right edge for a half, corners for quarters. A window has a minimum
  size, so it cannot be dragged into nothing.
- `window_title_position` puts titles at the bottom, the top, or nowhere.
- `hide_clock` removes the clock overlay.
- Titles show the window's custom name or the terminal's own title instead of
  a default ID.
- Animations can be turned off with `--no-animations` or with a keybind. Off
  means off: snap, minimize and restore apply at once instead of playing a
  zero-length tween that flashes.
- Recorded tapes start with `DisableAnimations`, so playback looks the same on
  any machine.

## tuios as a library

A first cut: `pkg/tuios` exposes the app as a Go package, with functional
options for theme, shell and animations, and the recommended `tea.Program`
settings for embedding it.

## Under the hood

- The module moved to charm.land: Bubble Tea v2.0.0-rc.2, Lipgloss v2, Wish v2,
  and sip v0.1.11 to match.
- The CLI was split into one module per command.
- The VT emulator synced with upstream: about forty deprecated mode constants
  renamed, a nil colour panic fix ported, and grapheme width calculation
  simplified enough to drop two dependencies.
- The layout, pool and theme packages got tests, and staticcheck and go vet run
  clean.

## Fixed

- Swapping windows in tiling mode updates the BSP tree, so a swap no longer
  snaps back on the next layout pass.
- Shift+Tab reaches the PTY as backtab even when the terminal reports extra
  modifier bits.
- On macOS, some `opt+` bindings were registered as `alt+`.
- Reattaching to a tiled daemon session sized windows from the stale 80x24
  handshake. Tiling now waits for the real size.
- Remote commands send maps and slices correctly, and the inspection commands
  work with no TUI attached.
- tuios-web got a `--no-animations` flag, theme setup, and a curl install
  script. An AUR conflict between `tuios` and `tuios-bin` was fixed.

## Documentation

Five new guides: BSP tiling, tape recording, the ShowKeys overlay, multi-client
sessions, and the library API.

A correction: the GitHub notes for v0.5.0 list tape recording and ShowKeys as
new features. Both shipped in v0.4.0. This release added their documentation.
