Skip to content

Pajn/Embers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embers

Embers is a Rust terminal multiplexer built around a headless server, a terminal UI client, and an automation-friendly command line interface. It manages sessions, windows, panes, floating popups, detachable terminal buffers, scrollback/history, and configurable key bindings through a Rhai-based config API.

The project is still early, but the shape is already close to a tmux-like workflow with a programmable client layer and durable PTY-backed buffers.

Features

  • Headless Unix-socket server with interactive terminal clients
  • Sessions, windows, panes, tab trees, splits, and floating popups
  • Durable terminal buffers that can be detached, reattached, moved, and captured
  • Scrollback, visible snapshots, search, selection, and yank-oriented client behavior
  • Scriptable Rhai config for key bindings, modes, actions, themes, tab bars, and hooks
  • CLI commands for scripting and automation
  • FlatBuffers protocol shared by the client and server crates

Requirements

  • Rust 1.92 or newer
  • flatc from FlatBuffers 25.12.19
  • mdbook when regenerating the config API docs

If you use Nix, the included flake provides the pinned development tools:

nix develop

Without Nix, make sure flatc is available on PATH before building.

Quick Start

Build the workspace:

cargo build --workspace

Run the interactive client:

cargo run -p embers-cli --bin embers

Running embers without a subcommand starts the background server if needed, creates or selects the default session, and attaches the terminal UI. Press Ctrl-q to leave the interactive client.

You can also install and run the binary directly:

cargo install --path crates/embers-cli
embers

CLI Usage

Embers exposes both an interactive client and command-oriented operations through the embers binary.

embers --help
embers list-sessions
embers new-session work
embers new-window --title logs -- tail -f app.log
embers split-window --horizontal -- cargo test
embers list-panes
embers capture-pane

By default, Embers uses a runtime socket at:

  • $XDG_RUNTIME_DIR/embers/embers.sock, when XDG_RUNTIME_DIR is set
  • /run/user/<uid>/embers/embers.sock, when available
  • /tmp/embers-<uid>/embers.sock, as a fallback

Override the socket with either --socket or EMBERS_SOCKET:

embers --socket /tmp/my-embers.sock list-sessions
EMBERS_SOCKET=/tmp/my-embers.sock embers attach

Useful subcommand groups include:

  • session: new-session, list-sessions, rename-session, kill-session
  • window: new-window, list-windows, select-window, rename-window, kill-window
  • pane: split-window, list-panes, select-pane, resize-pane, send-keys, capture-pane, kill-pane
  • buffer: buffer show, buffer history, buffer reveal, buffer pipe
  • node: node zoom, node swap, node break, node join-buffer, node move-before, node move-after
  • popup: display-popup, kill-popup

Configuration

Embers loads configuration in this order:

  1. --config <path>
  2. EMBERS_CONFIG
  3. The platform config directory for the embers application, typically ~/.config/embers/config.rhai on Linux
  4. Built-in defaults

User config is loaded as an overlay on top of the built-in defaults. The built-in config enables mouse behavior, scroll/search/select modes, and basic selection bindings.

This repository includes a fuller example at config.rhai. It defines a tmux-inspired leader, smart navigation for Vim/Neovim panes, split/tab helpers, popup helpers, history views, and a custom tab bar/theme.

Run with an explicit config while developing:

embers --config ./config.rhai

The generated config API reference lives in docs/config-api, with a rendered mdBook copy in docs/config-api-book.

Development

Run the test suite:

cargo test --workspace

Run formatting and lint checks:

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings

Regenerate the config API docs:

cargo gen-docs

The CI workflow also runs an ignored PTY smoke test:

cargo test -p embers-test-support pty_round_trips_input -- --ignored

Workspace Layout

Architecture Notes

The docs directory contains design notes that are useful when changing behavior:

License

This workspace is licensed under GPL-3.0-only.

About

Modern terminal multiplexer with durable buffers, recursive layouts, and scriptable control

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors