# Test fixtures

Source: https://libtmux.org/en/prompts/test-fixtures/

> Give each test its own isolated tmux server, torn down afterwards.

Give each test its own isolated tmux server, torn down afterwards.

Task

Give each test its own isolated tmux server, torn down afterwards.

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Python: The pytest plugin ships with the package: the `server` and
`session` fixtures, and `TestServer` for a socket of your own. See
src/libtmux/pytest_plugin.py.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.1.0.alpha.1 is the
   newest prerelease on RubyGems, and the command below names it because the
   resolver skips prereleases otherwise.
       bundle add libtmux --version 0.1.0.alpha.1
   Check https://rubygems.org/gems/libtmux for a newer version, and prefer a
   stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Ruby: This port does not export its test fixture. Scope each test with
`LibTmux::Server.start`, which owns a private socket and cleans it up on
block exit; do not copy `test/support/tmux_fixture.rb` into application
code.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.1.0alpha1-1 is the
   newest prerelease on LuaRocks, and the command below names it because the
   resolver skips prereleases otherwise.
       luarocks --local install libtmux 0.1.0alpha1-1
   Check https://luarocks.org/modules/tony/libtmux for a newer version, and
   prefer a stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Lua: This port does not export a test fixture. Start an explicit private
tmux socket in the test harness, connect through the selected runtime
adapter, and close both on every exit path.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.1.0-alpha2 is the
   newest prerelease on PowerShell Gallery, and the command below names it
   because the resolver skips prereleases otherwise.
       Install-Module -Name LibTmux -RequiredVersion 0.1.0-alpha2 -AllowPrerelease
   Check https://www.powershellgallery.com/packages/LibTmux for a newer
   version, and prefer a stable release over this one if there now is any.
   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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 at tag v0.1.0-alpha.1.
       using Pkg
       Pkg.add(PackageSpec(url="https://github.com/libtmux/libtmux-julia.git", rev="v0.1.0-alpha.1"))
   Check https://github.com/libtmux/libtmux-julia for a newer version, and
   prefer a stable release over this one if there now is any.
   Julia 1.10+ and tmux 3.2a+ are compatibility targets; see the
   compatibility guide for tested versions. Companion packages share the
   core source release.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.1.0-alpha.12 is the
   newest prerelease on npm, and the command below names it because the
   resolver skips prereleases otherwise.
       bun add libtmux@0.1.0-alpha.12
   Check https://www.npmjs.com/package/libtmux for a newer version, and
   prefer a stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For TypeScript: This port does not export a test fixture yet; its launcher
is internal. Build the fixture on the public API and say what you needed
that was missing, so it can be vended properly.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.1.0-alpha.15 is the
   newest prerelease on crates.io, and the command below names it because the
   resolver skips prereleases otherwise.
       cargo add libtmux@0.1.0-alpha.15
   Check https://crates.io/crates/libtmux for a newer version, and prefer a
   stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Rust: Use `libtmux::test::TestServer`, which runs an isolated server and
shuts it down on drop.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable
   release. v0.0.1-alpha.9 is the newest prerelease on pkg.go.dev, and the
   command below names it because the resolver skips prereleases otherwise.
       go get github.com/libtmux/libtmux-go@v0.0.1-alpha.9
   Check https://pkg.go.dev/github.com/libtmux/libtmux-go/tmux for a newer
   version, and prefer a stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Go: Use `tmuxtest.NewServer(ctx, t)` from
`github.com/libtmux/libtmux-go/tmux/tmuxtest`, which registers its own
cleanup.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release.
   0.0.1-alpha.17 is the newest prerelease on Maven Central, and the command
   below names it because the resolver skips prereleases otherwise.
       implementation("io.github.libtmux:libtmux:0.0.1-alpha.17")
   Check https://central.sonatype.com/artifact/io.github.libtmux/libtmux for
   a newer version, and prefer a stable release over this one if there now
   is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Java: Use the JUnit 5 support in `io.github.libtmux.junit5`:
`TmuxExtension`, and `NamedServerFixture` when the socket name matters.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable
   release. 0.0.1-alpha.17 is the newest prerelease on Maven Central, and the
   command below names it because the resolver skips prereleases otherwise.
       implementation("io.github.libtmux:libtmux-kotlin:0.0.1-alpha.17")
   Check
   https://central.sonatype.com/artifact/io.github.libtmux/libtmux-kotlin
   for a newer version, and prefer a stable release over this one if there
   now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable
   release. 0.0.1-alpha.17 is the newest prerelease on Maven Central, and the
   command below names it because the resolver skips prereleases otherwise.
       libraryDependencies += "io.github.libtmux" %% "libtmux-scala" % "0.0.1-alpha.17"
   Check
   https://central.sonatype.com/artifact/io.github.libtmux/libtmux-scala_3
   for a newer version, and prefer a stable release over this one if there
   now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.0.0-alpha.21 is the
   newest prerelease on NuGet, and the command below names it because the
   resolver skips prereleases otherwise.
       dotnet add package LibTmux --version 0.0.0-alpha.21
   Check https://www.nuget.org/packages/LibTmux for a newer version, and
   prefer a stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For C#: Use `LibTmux.Testing.TemporaryServerScope`, which is
`IAsyncDisposable`, so `await using` handles teardown on the failure path.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.0.0-alpha.21
   is the newest prerelease on NuGet, and the command below names it because
   the resolver skips prereleases otherwise.
       dotnet package add LibTmux.FSharp --version 0.0.0-alpha.21
   Check https://www.nuget.org/packages/LibTmux.FSharp for a newer version,
   and prefer a stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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-alpha.11.
       include(FetchContent)
       FetchContent_Declare(libtmux-cxx
         GIT_REPOSITORY https://github.com/libtmux/libtmux-cxx
         GIT_TAG v0.1.0-alpha.11)
       FetchContent_MakeAvailable(libtmux-cxx)
   Check https://github.com/libtmux/libtmux-cxx for a newer version, and
   prefer a stable release over this one if there now is any.
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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For C++: Use `libtmux::testing::ScopedTmuxServer` from
`<libtmux/testing/scoped_server.hpp>`, whose destructor reports teardown.
```

```
Then set up tmux test fixtures so this project can test code that drives
tmux.

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 has no stable release. 0.1.0-alpha.6 is
   the newest prerelease on Swift Package Index, and the command below names it
   because the resolver skips prereleases otherwise.
       .package(url: "https://github.com/libtmux/libtmux-swift", exact: "0.1.0-alpha.6")
   Check https://swiftpackageindex.com/libtmux/libtmux-swift for a newer
   version, and prefer a stable release over this one if there now is any.
   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.

Test fixtures

What it does:
- Gives each test an isolated tmux server on its own socket, so tests do not
  see each other's sessions and do not touch the tmux I am using right now.
- Tears the server down when the test ends, including when it fails.
- Provides a ready-made session or window for tests that need one.
- Includes two example tests: one that creates a session and asserts on it, and
  one that sends input to a pane and asserts on the captured output.

Constraints:
- Use this port's own test helper rather than writing a new one. Find it in the
  API reference above; every port ships something for this. Do not invent a
  name for it.
- Waiting for a program to produce output is a synchronisation problem, not a
  sleep. A fixed delay makes the suite slow and flaky at the same time.
- Make sure a failing test cannot leak a server. Show how the teardown runs on
  the failure path.

Anchor it in these pages:
- https://libtmux.org/en/tmux/guides/testing-with-libtmux/  testing with libtmux
- https://libtmux.org/en/tmux/concepts/transports/          transports

For Swift: Use `withTmuxServer { }` from the `TmuxFixture` library product,
which scopes the server to the closure.
```

## As plain text

The same prompt per language, as a file rather than a page.

* [Python](https://libtmux.org/en/prompts/py/test-fixtures.txt)
* [Ruby](https://libtmux.org/en/prompts/ruby/test-fixtures.txt)
* [Lua](https://libtmux.org/en/prompts/lua/test-fixtures.txt)
* [PowerShell](https://libtmux.org/en/prompts/powershell/test-fixtures.txt)
* [Julia](https://libtmux.org/en/prompts/julia/test-fixtures.txt)
* [TypeScript](https://libtmux.org/en/prompts/ts/test-fixtures.txt)
* [Rust](https://libtmux.org/en/prompts/rs/test-fixtures.txt)
* [Go](https://libtmux.org/en/prompts/go/test-fixtures.txt)
* [Java](https://libtmux.org/en/prompts/java/test-fixtures.txt)
* [Kotlin](https://libtmux.org/en/prompts/kotlin/test-fixtures.txt)
* [Scala](https://libtmux.org/en/prompts/scala/test-fixtures.txt)
* [C#](https://libtmux.org/en/prompts/csharp/test-fixtures.txt)
* [F#](https://libtmux.org/en/prompts/fsharp/test-fixtures.txt)
* [C++](https://libtmux.org/en/prompts/cxx/test-fixtures.txt)
* [Swift](https://libtmux.org/en/prompts/swift/test-fixtures.txt)

## What it reads

This prompt anchors the work in these pages, and tells the agent to use them rather than guess API names.

* [guides/testing-with-libtmux](https://libtmux.org/en/tmux/guides/testing-with-libtmux/)
* [concepts/transports](https://libtmux.org/en/tmux/concepts/transports/)
