Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

tmux, in your language

Control tmux from your application.

Create sessions, arrange panes, send input, and capture output.

Start with Python

from __future__ import annotations
from pathlib import Path
import tempfile
import time
import libtmux
from libtmux.constants import PaneDirection
directory = Path(tempfile.mkdtemp(prefix="libtmux-py-home-"))
socket = directory / "tmux.sock"
server = libtmux.Server(socket_path=socket, config_file="/dev/null")
session = server.new_session(session_name="demo")
# Lay out the session: name its window, split it, add a second window.
editor = session.active_window
editor.rename_window("editor")
left = editor.active_pane
assert left is not None
right = left.split(direction=PaneDirection.Right, shell="sh")
logs = session.new_window(window_name="logs")
# Type a command into the new pane and wait for what it prints.
right.send_keys("printf 'hello from %s\\n' tmux", enter=True)
deadline = time.monotonic() + 5
while "hello from tmux" not in right.capture_pane():
if time.monotonic() >= deadline:
raise TimeoutError("The pane did not print hello from tmux")
time.sleep(0.02)
# Move the focus an attached client sees: the pane, then the window.
right.select()
logs.select()
# Walk the objects: down from the server, then up from one pane.
sessions = server.sessions
for each in sessions:
print("session", each.session_name)
windows = each.windows
for window in windows:
panes = window.panes
ids = " ".join(pane.pane_id for pane in panes)
print(f" window {window.window_index}:{window.window_name}: {ids}")
window = right.window
owner = window.session
print(right.pane_id, "is in window", window.window_name,
"of session", owner.session_name)
from __future__ import annotations
from pathlib import Path
import tempfile
import time
import libtmux
from libtmux.constants import PaneDirection
directory = Path(tempfile.mkdtemp(prefix="libtmux-py-home-"))
socket = directory / "tmux.sock"
server = libtmux.Server(socket_path=socket, config_file="/dev/null")
try:
session = server.new_session(session_name="demo")
# Lay out the session: name its window, split it, add a second window.
editor = session.active_window
editor.rename_window("editor")
left = editor.active_pane
assert left is not None
right = left.split(direction=PaneDirection.Right, shell="sh")
logs = session.new_window(window_name="logs")
# Type a command into the new pane and wait for what it prints.
right.send_keys("printf 'hello from %s\\n' tmux", enter=True)
deadline = time.monotonic() + 5
while "hello from tmux" not in right.capture_pane():
if time.monotonic() >= deadline:
raise TimeoutError("The pane did not print hello from tmux")
time.sleep(0.02)
# Move the focus an attached client sees: the pane, then the window.
right.select()
logs.select()
# Walk the objects: down from the server, then up from one pane.
sessions = server.sessions
for each in sessions:
print("session", each.session_name)
windows = each.windows
for window in windows:
panes = window.panes
ids = " ".join(pane.pane_id for pane in panes)
print(f" window {window.window_index}:{window.window_name}: {ids}")
window = right.window
owner = window.session
print(right.pane_id, "is in window", window.window_name,
"of session", owner.session_name)
except Exception as error:
raise RuntimeError("tmux quickstart failed") from error
from __future__ import annotations
from pathlib import Path
import shutil
import tempfile
import time
import libtmux
from libtmux.constants import PaneDirection
directory = Path(tempfile.mkdtemp(prefix="libtmux-py-home-"))
socket = directory / "tmux.sock"
server = libtmux.Server(socket_path=socket, config_file="/dev/null")
try:
session = server.new_session(session_name="demo")
# Lay out the session: name its window, split it, add a second window.
editor = session.active_window
editor.rename_window("editor")
left = editor.active_pane
assert left is not None
right = left.split(direction=PaneDirection.Right, shell="sh")
logs = session.new_window(window_name="logs")
# Type a command into the new pane and wait for what it prints.
right.send_keys("printf 'hello from %s\\n' tmux", enter=True)
deadline = time.monotonic() + 5
while "hello from tmux" not in right.capture_pane():
if time.monotonic() >= deadline:
raise TimeoutError("The pane did not print hello from tmux")
time.sleep(0.02)
# Move the focus an attached client sees: the pane, then the window.
right.select()
logs.select()
# Walk the objects: down from the server, then up from one pane.
sessions = server.sessions
for each in sessions:
print("session", each.session_name)
windows = each.windows
for window in windows:
panes = window.panes
ids = " ".join(pane.pane_id for pane in panes)
print(f" window {window.window_index}:{window.window_name}: {ids}")
window = right.window
owner = window.session
print(right.pane_id, "is in window", window.window_name,
"of session", owner.session_name)
finally:
if socket.exists():
server.kill()
shutil.rmtree(directory)
from __future__ import annotations
from pathlib import Path
import shutil
import tempfile
import time
import libtmux
from libtmux.constants import PaneDirection
directory = Path(tempfile.mkdtemp(prefix="libtmux-py-home-"))
socket = directory / "tmux.sock"
server = libtmux.Server(socket_path=socket, config_file="/dev/null")
try:
session = server.new_session(session_name="demo")
# Lay out the session: name its window, split it, add a second window.
editor = session.active_window
editor.rename_window("editor")
left = editor.active_pane
assert left is not None
right = left.split(direction=PaneDirection.Right, shell="sh")
logs = session.new_window(window_name="logs")
# Type a command into the new pane and wait for what it prints.
right.send_keys("printf 'hello from %s\\n' tmux", enter=True)
deadline = time.monotonic() + 5
while "hello from tmux" not in right.capture_pane():
if time.monotonic() >= deadline:
raise TimeoutError("The pane did not print hello from tmux")
time.sleep(0.02)
# Move the focus an attached client sees: the pane, then the window.
right.select()
logs.select()
# Walk the objects: down from the server, then up from one pane.
sessions = server.sessions
for each in sessions:
print("session", each.session_name)
windows = each.windows
for window in windows:
panes = window.panes
ids = " ".join(pane.pane_id for pane in panes)
print(f" window {window.window_index}:{window.window_name}: {ids}")
window = right.window
owner = window.session
print(right.pane_id, "is in window", window.window_name,
"of session", owner.session_name)
except Exception as error:
raise RuntimeError("tmux quickstart failed") from error
finally:
if socket.exists():
server.kill()
shutil.rmtree(directory)
Example details
Run this example

POSIX shell, tmux 3.2a or newer, Python 3.14.6 and uv (tested 0.12.0).

Save the program above as quickstart.py 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.

Setup and run

uv venv .venv
uv pip install --python .venv/bin/python libtmux==0.62.0
unset TMUX TMUX_PANE
export ENV=/dev/null BASH_ENV=/dev/null SHELL=/bin/sh
.venv/bin/python quickstart.py

Expected output

session demo
window 0:editor: %0 %1
window 1:logs: %2
%1 is in window editor of session demo

Dependency cooldowns

The checkbox turns a cooldown on and off for every picker on the site. It applies to what an install pulls in; the package itself, and the libtmux it pins, stay current.

Cooldown type
What are cooldowns?

Cooldowns delay picking up newly uploaded packages so the community has time to spot supply-chain attacks before you install. Most package managers don't apply one by default; you opt in through a global setting in your tool's configuration.

Learn more at cooldowns.dev · Datadog Security Labs writeup.

$ pip install libtmux
$ pip install libtmux

pip cannot exempt libtmux from its own cooldown, so a cooldown here would also hold back the release this installs. This command runs without one.

$ pip install libtmux

pip cannot exempt libtmux from its own cooldown, so a cooldown here would also hold back the release this installs. This command runs without one.

$ uv add libtmux
$ uv add \
    --exclude-newer P7D \
    --exclude-newer-package libtmux=2099-01-01 \
    libtmux
$ uv add --no-config libtmux
$ pipx install libtmux
$ pipx install libtmux

pipx cannot exempt libtmux from its own cooldown, so a cooldown here would also hold back the release this installs. This command runs without one.

$ pipx install libtmux

pipx cannot exempt libtmux from its own cooldown, so a cooldown here would also hold back the release this installs. This command runs without one.

Start with an agent

Copy this into any coding agent. It installs libtmux in the repository you are in, checks the install against a real tmux server, and points the agent at this site's llms.txt and docs.json so it reads the API rather than guessing it. Use the language selected above, then pick a task.

Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Python
Package:    libtmux (PyPI)
Repository: https://github.com/tmux-python/libtmux

Read these before writing code:
- https://libtmux.org/en/py/latest/llms.txt
  every page for Python, as a list
- https://libtmux.org/en/py/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/py/latest/reference/
  the Python API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Python project yet, start one:
       uv init
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux 0.62.0 is the current release on PyPI.
       uv add libtmux
   Check https://pypi.org/project/libtmux/ if you need a different version.
   If this project already uses pip, Poetry or PDM, add the dependency with
   that tool instead: the package is the same.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Ruby
Package:    libtmux (RubyGems)
Repository: https://github.com/libtmux/libtmux-ruby

Read these before writing code:
- https://libtmux.org/en/ruby/latest/llms.txt
  every page for Ruby, as a list
- https://libtmux.org/en/ruby/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/ruby/latest/reference/
  the Ruby API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Ruby project yet, start one:
       bundle init
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux 0.1.2 is the current release on RubyGems.
       bundle add libtmux
   Check https://rubygems.org/gems/libtmux if you need a different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Lua
Package:    libtmux (LuaRocks)
Repository: https://github.com/libtmux/libtmux-lua

Read these before writing code:
- https://libtmux.org/en/lua/latest/llms.txt
  every page for Lua, as a list
- https://libtmux.org/en/lua/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/lua/latest/reference/
  the Lua API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Lua project yet, start one:
       luarocks init
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux 0.1.1-1 is the current release on LuaRocks.
       luarocks --local install libtmux
   Check https://luarocks.org/modules/tony/libtmux if you need a different
   version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   PowerShell
Package:    LibTmux (PowerShell Gallery)
Repository: https://github.com/libtmux/libtmux-powershell

Read these before writing code:
- https://libtmux.org/en/powershell/latest/llms.txt
  every page for PowerShell, as a list
- https://libtmux.org/en/powershell/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/powershell/latest/reference/
  the PowerShell API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a PowerShell project yet, Create a PowerShell
   script in this directory; no project manifest is required.
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. LibTmux 0.1.0 is the current release on PowerShell
   Gallery.
       Install-Module -Name LibTmux
   Check https://www.powershellgallery.com/packages/LibTmux if you need a
   different version.
   Import LibTmux after installation. LibTmux.Workspace is a separate
   module; the .NET MCP tool does not import either module.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Julia
Package:    LibTmux (its repository)
Repository: https://github.com/libtmux/libtmux-julia

Read these before writing code:
- https://libtmux.org/en/julia/latest/llms.txt
  every page for Julia, as a list
- https://libtmux.org/en/julia/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/julia/latest/reference/
  the Julia API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Julia project yet, start one:
       using Pkg
Pkg.activate(".")
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. LibTmux is not published to its registry yet, so this
   installs from the repository's default branch. The newest release tag is
   v0.1.1.
       using Pkg
       Pkg.add(PackageSpec(url="https://github.com/libtmux/libtmux-julia.git", rev="master"))
   Check https://github.com/libtmux/libtmux-julia if you need a different
   version.
   Requires Julia 1.13.1 and tmux 3.3a or newer. JSON layouts require tmux
   3.8. Companion packages install from the same revision as the core.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Erlang
Package:    libtmux_erlang (its repository)
Repository: https://github.com/libtmux/libtmux-erlang

Read these before writing code:
- https://libtmux.org/en/erlang/latest/llms.txt
  every page for Erlang, as a list
- https://libtmux.org/en/erlang/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/erlang/latest/reference/
  the Erlang API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Erlang project yet, start one:
       rebar3 new lib tmux_example && cd tmux_example
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux_erlang is not published to its registry yet
   and the repository has no release tag, so this installs from its default
   branch.
       {deps, [
           {libtmux_erlang, {git_subdir,
               "https://github.com/libtmux/libtmux-erlang.git",
               {ref, "master"}, "apps/libtmux_erlang"}}
       ]}.
   Check https://github.com/libtmux/libtmux-erlang for a newer version, and
   prefer a final release if there now is one.
   Add libtmux_erlang to your application dependencies and start it with
   application:ensure_all_started/1. Native records are experimental in OTP
   29. The Git subdirectory selects the core application from its umbrella
   repository.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Elixir
Package:    libtmux (Hex)
Repository: https://github.com/libtmux/libtmux-elixir

Read these before writing code:
- https://libtmux.org/en/elixir/latest/llms.txt
  every page for Elixir, as a list
- https://libtmux.org/en/elixir/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/elixir/latest/reference/
  the Elixir API reference
- https://libtmux.hexdocs.pm/
  Elixir reference on HexDocs
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Elixir project yet, start one:
       mix new my_app
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux 0.1.1 is the current release on Hex.
       {:libtmux, "~> 0.1.1"}
   Check https://hex.pm/packages/libtmux if you need a different version.
   Add the tuple to the deps list in mix.exs and run mix deps.get. Requires
   Elixir 1.20.4 or newer, Erlang/OTP 29.1.2 or a newer 29.x release, and
   tmux 3.3 or newer (the planned floor); Linux builds need a C11 compiler.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify its pure values API.

The public Haskell package provides pure typed IDs, checked scalar values
and tmux-version parsing. Documentation for every language
is at https://libtmux.org/en/.

Language:   Haskell
Package:    libtmux-haskell (its repository)
Repository: https://github.com/libtmux/libtmux-haskell

Read these before writing code:
- https://libtmux.org/en/haskell/latest/llms.txt
  every page for Haskell, as a list
- https://libtmux.org/en/haskell/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/haskell/latest/reference/
  the Haskell API reference
- https://libtmux.org/en/haskell/latest/core/
  the complete public values example and Cabal files
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Select GHC 9.14.1 and Cabal 3.18.2.0. Report both tool versions.
   The public values example does not require a tmux installation.
2. If this directory is not a Haskell project yet, start one:
       cabal init --non-interactive --exe --language=GHC2024 --dependency="base >=4.22 && <4.23, libtmux-haskell ^>=0.1.0.0"
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux-haskell is not published to its registry yet
   and the repository has no release tag, so this installs from its default
   branch.
       packages: .
       
       source-repository-package
         type: git
         location: https://github.com/libtmux/libtmux-haskell
         tag: master
   Check https://github.com/libtmux/libtmux-haskell if you need a different
   version.
   The public API currently provides pure typed IDs, checked values and
   tmux-version admission. Server, capture and command APIs are under
   development. Workspace is planned; MCP is excluded.
4. Run the complete values example linked above. Use parseWindowId and
   renderWindowId to check the ID round trip, handle parse errors, and
   verify the expected output. Show the output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Common Lisp
Package:    libtmux (its repository)
Repository: https://github.com/libtmux/libtmux-lisp

Read these before writing code:
- https://libtmux.org/en/lisp/latest/llms.txt
  every page for Common Lisp, as a list
- https://libtmux.org/en/lisp/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/lisp/latest/reference/
  the Common Lisp API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Common Lisp project yet, start one:
       mkdir my-tmux-app
cd my-tmux-app
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux is not published to its registry yet and the
   repository has no release tag, so this installs from its default branch.
       git clone https://github.com/libtmux/libtmux-lisp.git vendor/libtmux-lisp
   Check https://github.com/libtmux/libtmux-lisp for a newer version, and
   prefer a final release if there now is one.
   Source-only and unreleased. Requires Linux x86-64, SBCL 2.6.10, ASDF/UIOP
   3.3.7 and tmux 3.3a or newer; plain tmux 3.3 is rejected.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   TypeScript
Package:    libtmux (npm)
Repository: https://github.com/libtmux/libtmux-ts

Read these before writing code:
- https://libtmux.org/en/ts/latest/llms.txt
  every page for TypeScript, as a list
- https://libtmux.org/en/ts/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/ts/latest/reference/
  the TypeScript API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a TypeScript project yet, start one:
       bun init
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux 0.1.2 is the current release on npm.
       bun add libtmux
   Check https://www.npmjs.com/package/libtmux if you need a different
   version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Rust
Package:    libtmux (crates.io)
Repository: https://github.com/libtmux/libtmux-rs

Read these before writing code:
- https://libtmux.org/en/rs/latest/llms.txt
  every page for Rust, as a list
- https://libtmux.org/en/rs/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/rs/latest/reference/
  the Rust API reference
- https://docs.rs/libtmux
  Rust reference on docs.rs
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Rust project yet, start one:
       cargo init
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux 0.1.2 is the current release on crates.io.
       cargo add libtmux
   Check https://crates.io/crates/libtmux if you need a different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Go
Package:    github.com/libtmux/libtmux-go/tmux (pkg.go.dev)
Repository: https://github.com/libtmux/libtmux-go

Read these before writing code:
- https://libtmux.org/en/go/latest/llms.txt
  every page for Go, as a list
- https://libtmux.org/en/go/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/go/latest/reference/
  the Go API reference
- https://pkg.go.dev/github.com/libtmux/libtmux-go/tmux
  Go reference on pkg.go.dev
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Go project yet, start one:
       go mod init example.com/tmuxdemo
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. github.com/libtmux/libtmux-go/tmux v0.1.3 is the
   current release on pkg.go.dev.
       go get github.com/libtmux/libtmux-go
   Check https://pkg.go.dev/github.com/libtmux/libtmux-go/tmux if you need a
   different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Java
Package:    io.github.libtmux:libtmux (Maven Central)
Repository: https://github.com/libtmux/libtmux-java

Read these before writing code:
- https://libtmux.org/en/java/latest/llms.txt
  every page for Java, as a list
- https://libtmux.org/en/java/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/java/latest/reference/
  the Java API reference
- https://javadoc.io/doc/io.github.libtmux/libtmux
  Java reference on javadoc.io
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Java project yet, start one:
       gradle init --type java-application --dsl kotlin
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. io.github.libtmux:libtmux 0.1.2 is the current
   release on Maven Central.
       implementation("io.github.libtmux:libtmux:0.1.2")
   Check https://central.sonatype.com/artifact/io.github.libtmux/libtmux if
   you need a different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Clojure
Package:    io.github.libtmux:libtmux-clojure (its repository)
Repository: https://github.com/libtmux/libtmux-java

Read these before writing code:
- https://libtmux.org/en/clojure/latest/llms.txt
  every page for Clojure, as a list
- https://libtmux.org/en/clojure/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/clojure/latest/reference/
  the Clojure API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Clojure project yet, start one:
       mkdir clojure-tmux && cd clojure-tmux
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. io.github.libtmux:libtmux-clojure is not published to
   its registry yet, so this installs from the repository's default branch. The
   newest release tag is v0.1.2.
       git clone --branch master https://github.com/libtmux/libtmux-java && (cd libtmux-java && ./gradlew :libtmux:publishToMavenLocal :libtmux-clojure:publishToMavenLocal)
   Check https://github.com/libtmux/libtmux-java if you need a different
   version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Kotlin
Package:    io.github.libtmux:libtmux-kotlin (Maven Central)
Repository: https://github.com/libtmux/libtmux-java

Read these before writing code:
- https://libtmux.org/en/kotlin/latest/llms.txt
  every page for Kotlin, as a list
- https://libtmux.org/en/kotlin/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/kotlin/latest/reference/
  the Kotlin API reference
- https://javadoc.io/doc/io.github.libtmux/libtmux-kotlin
  Kotlin reference on Dokka
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Kotlin project yet, start one:
       gradle init --type kotlin-application --dsl kotlin
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. io.github.libtmux:libtmux-kotlin 0.1.2 is the current
   release on Maven Central.
       implementation("io.github.libtmux:libtmux-kotlin:0.1.2")
   Check
   https://central.sonatype.com/artifact/io.github.libtmux/libtmux-kotlin if
   you need a different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Scala
Package:    io.github.libtmux:libtmux-scala_3 (Maven Central)
Repository: https://github.com/libtmux/libtmux-java

Read these before writing code:
- https://libtmux.org/en/scala/latest/llms.txt
  every page for Scala, as a list
- https://libtmux.org/en/scala/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/scala/latest/reference/
  the Scala API reference
- https://javadoc.io/doc/io.github.libtmux/libtmux-scala_3
  Scala reference on Scaladoc
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Scala project yet, start one:
       sbt new scala/scala3.g8
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. io.github.libtmux:libtmux-scala_3 0.1.2 is the
   current release on Maven Central.
       libraryDependencies += "io.github.libtmux" %% "libtmux-scala" % "0.1.2"
   Check
   https://central.sonatype.com/artifact/io.github.libtmux/libtmux-scala_3
   if you need a different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   C#
Package:    LibTmux (NuGet)
Repository: https://github.com/libtmux/libtmux-dotnet

Read these before writing code:
- https://libtmux.org/en/csharp/latest/llms.txt
  every page for C#, as a list
- https://libtmux.org/en/csharp/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/csharp/latest/reference/
  the C# API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a C# project yet, start one:
       dotnet new console
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. LibTmux 0.1.1 is the current release on NuGet.
       dotnet add package LibTmux
   Check https://www.nuget.org/packages/LibTmux if you need a different
   version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   F#
Package:    LibTmux.FSharp (NuGet)
Repository: https://github.com/libtmux/libtmux-dotnet

Read these before writing code:
- https://libtmux.org/en/fsharp/latest/llms.txt
  every page for F#, as a list
- https://libtmux.org/en/fsharp/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/fsharp/latest/reference/
  the F# API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a F# project yet, start one:
       dotnet new console --language F#
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. LibTmux.FSharp 0.1.1 is the current release on NuGet.
       dotnet package add LibTmux.FSharp
   Check https://www.nuget.org/packages/LibTmux.FSharp if you need a
   different version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   C++
Package:    libtmux-cxx (its repository)
Repository: https://github.com/libtmux/libtmux-cxx

Read these before writing code:
- https://libtmux.org/en/cxx/latest/llms.txt
  every page for C++, as a list
- https://libtmux.org/en/cxx/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/cxx/latest/reference/
  the C++ API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a C++ project yet, write a CMakeLists.txt
   declaring cmake_minimum_required and project(), targeting C++23.
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux-cxx is not published to its registry yet, so
   this installs from the repository at tag v0.1.0.
       include(FetchContent)
       FetchContent_Declare(libtmux-cxx
         GIT_REPOSITORY https://github.com/libtmux/libtmux-cxx
         GIT_TAG v0.1.0)
       FetchContent_MakeAvailable(libtmux-cxx)
   Check https://github.com/libtmux/libtmux-cxx if you need a different
   version.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Swift
Package:    libtmux-swift (Swift Package Index)
Repository: https://github.com/libtmux/libtmux-swift

Read these before writing code:
- https://libtmux.org/en/swift/latest/llms.txt
  every page for Swift, as a list
- https://libtmux.org/en/swift/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/swift/latest/reference/
  the Swift API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Swift project yet, start one:
       swift package init --type executable
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux-swift 0.1.1 is the current release on Swift
   Package Index.
       .package(url: "https://github.com/libtmux/libtmux-swift", from: "0.1.1")
   Check https://swiftpackageindex.com/libtmux/libtmux-swift if you need a
   different version.
   A target depends on the product, not the package: write .product(name:
   "LibTmux", package: "libtmux-swift"). The library is `LibTmux` while the
   package identity SwiftPM derives from the URL is `libtmux-swift`, which
   is neither the product name nor the `name:` in the package manifest.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   OCaml
Package:    libtmux (its repository)
Repository: https://github.com/libtmux/libtmux-ocaml

Read these before writing code:
- https://libtmux.org/en/ocaml/latest/llms.txt
  every page for OCaml, as a list
- https://libtmux.org/en/ocaml/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/ocaml/latest/reference/
  the OCaml API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a OCaml project yet, start one:
       dune init project my_tmux_app
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. libtmux is not published to its registry yet and the
   repository has no release tag, so this installs from its default branch.
       git clone https://github.com/libtmux/libtmux-ocaml.git && \
         cd libtmux-ocaml && \
         opam install .
   Check https://github.com/libtmux/libtmux-ocaml for a newer version, and
   prefer a final release if there now is one.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.
Set up libtmux in this repository and verify it against a real tmux server.

libtmux drives a real tmux server from code. It gives you objects for the
server, its sessions, windows and panes. Documentation for every language
is at https://libtmux.org/en/.

Language:   Perl
Package:    LibTmux (its repository)
Repository: https://github.com/libtmux/libtmux-perl

Read these before writing code:
- https://libtmux.org/en/perl/latest/llms.txt
  every page for Perl, as a list
- https://libtmux.org/en/perl/latest/docs.json
  the same list with headings, as JSON
- https://libtmux.org/en/perl/latest/reference/
  the Perl API reference
If you cannot fetch URLs, clone the repository above and read its README
and examples instead, or ask me to paste those pages in.

Set up first:
1. Report the tmux version with `tmux -V`. libtmux drives a real tmux, so
   nothing below works without one. Stop and tell me if it is missing.
2. If this directory is not a Perl project yet, Create a Perl program using
   LibTmux::Server; install from the source checkout.
   Skip this in a project that already exists, and match what is here.
3. Add the dependency. LibTmux is not published to its registry yet and the
   repository has no release tag, so this installs from its default branch.
       git clone https://github.com/libtmux/libtmux-perl.git && \
         cd libtmux-perl && \
         cpm install --global ./packages/core
   Check https://github.com/libtmux/libtmux-perl for a newer version, and
   prefer a final release if there now is one.
   Install core before workspace or optional async. These package names do
   not identify published CPAN releases.
4. Write the smallest program that proves the install works: connect to a
   tmux server, create a session, confirm it is there, then kill it. Give
   that server a socket of its own rather than using the default one, so
   this never touches a tmux I am already running. Run it, and show me the
   output and the files you added.

Rules for everything below:
- Use the reference above rather than guessing names. The ten libtmux
  ports do not share spellings, and a name from another language will look
  plausible and not exist.
- If the reference does not have something you expected, say so instead of
  writing a call that does not exist.
- Follow the conventions already in this repository.

All prompts, including a plain-text URL per language and task that an agent can fetch.

Esc

Type to search.

Reference previewOpen reference