package

github.com/ch1c0t/crystal.tmux

main / published Oct 31, 2026 / repository

Crystal Tmux API

The shard also exposes a top-level Tmux module with an object model inspired by libtmux:

require "tmux"

server = Tmux::Server.new
session = server.new_session("demo", detached: true)
window = session.active_window
pane = window.active_pane

pane.send_keys("echo hello")
sleep 0.1
puts pane.capture_pane.join("\n")

The core API covers server, session, window, and pane traversal; creating sessions and windows; splitting panes; sending keys; capturing pane output; self-location through tmux environment variables; and raw command execution.

Development

shards install
bundle exec rake
crystal spec

The API end-to-end spec starts a separate Tmux server using a unique socket.

API