Early release libtmux is released, and its APIs may still change between releases.
This site's structure and URLs may change too.
libtmux for Julia
Julia-based tmux client
tmux client library for Julia. Control tmux, connect to and create servers, navigate sessions, windows, and panes, send keys, watch for changes via control mode, capture pane contents
using LibTmux
# A private server: a socket and an empty config of its own, so this
# neither touches nor is changed by a tmux you already use.
owned =open_server()
server = owned.server
demo =new_session(server; name="demo")
# Lay out the session: name its window, split it, add a second window.
editor =only(windows(snapshot(server, demo))).ref
rename_window(server, editor, "editor")
left =only(filter(p -> p.active, panes(snapshot(server, editor)))).ref
right =split_window(server, left; direction=:right)
logs =new_window(server, demo; name="logs")
# Type a command into the new pane and wait for what it prints.
send_keys(server, right, "printf 'hello from %s\\n' tmux", "Enter")
wait_for_text(server, right, "hello from tmux"; baseline=true)
# Move the focus an attached client sees: the pane, then the window.
Save the program above as quickstart.jl in a new directory, along with the files below.
Cleanup is omitted; the private tmux server and its temporary files may remain. Select Cleanup to remove them when the program finishes.The program stops its private tmux server and removes any temporary files it created when it finishes. Error handling adds diagnostics; every version checks required results and deadlines.
using PkgPkg.activate(".")Pkg.add(PackageSpec( url="https://github.com/libtmux/libtmux-julia.git", rev="4ff1a9b077bb505a1d8a97a222ffa0d01c9f363a",))
Run in Julia with tmux on PATH. The package is not registered in General, so this installs from Git; Manifest.toml records the package tree hash.
MCP
tmux through MCP
ReplayHover a call to preview the tmux state after it. Click to pin it.
%0 cat
[docs]0:cat*
tmux before the first call.
%1 sh
[checks]0:sh*
tmux after create_session.
%1 sh
%2 sh
[checks]0:sh*
tmux after send_keys.
%1 sh
%2 sh
[checks]0:sh*
tmux after list_panes: unchanged, the call only reads.
%1 sh
%2 sh
[checks]0:sh*
tmux after send_keys_and_wait.
%1 sh
%2 sh
[checks]0:sh*
tmux after send_keys_and_wait.
%0 cat
[docs]0:cat*
tmux after teardown_session.
you
Create a tmux session called checks, split its window into two panes, run pytest -q in one and show checks.log in the other, show me the results, then remove the session.
$ claude mcp add tmux -- /absolute/path/to/project/bin/libtmux-mcp \ --socket /absolute/path/to/tmux.sock
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
$ claude mcp add tmux --scope user -- \ /absolute/path/to/project/bin/libtmux-mcp \ --socket /absolute/path/to/tmux.sock
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Config file: .mcp.json (in repo, version-controlled)
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
PresetThree panesShort-hand panesTwo panesFour panesMain-horizontal layoutSetup before each paneEnvironmentStart directorySynchronized panesBlank panesVariables in valuesFocusMain pane height as a percentageShell per paneKeep commands out of historyWindow index
Run in Julia. Neither package is registered in General, so this installs from Git. Add the core and workspace packages in one call so both use the same revision.