Skip to content

Show how to read a session on an existing tmux server - #183

Merged
tony merged 2 commits into
masterfrom
connect-existing-session
Dec 6, 2026
Merged

tony merged 2 commits into
masterfrom
connect-existing-session

Conversation

@tony

@tony tony commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Set LIBTMUX_SOCKET_PATH to a running tmux server’s socket to read its work session. The example prints the session name and closes its connection. The Lua integration test checks that the caller’s server survives.

Leave LIBTMUX_SOCKET_PATH unset to run the example on its own private server. The installed-package test exercises that path, including cleanup after a failure.

Test plan

  • luajit scripts/support/run_tests.lua scripts/docs/tests/test_api_examples.lua
  • luajit scripts/check/check.lua integration server --lua .cache/toolchains/lua-5.5.1/bin/lua --nvim .cache/toolchains/nvim-0.12.5/bin/nvim (0.70 seconds on Linux ARM64)
  • luajit scripts/check/check.lua docs --lua .cache/toolchains/lua-5.5.1/bin/lua --nvim .cache/toolchains/nvim-0.12.5/bin/nvim

Related to #116.

tony added 2 commits December 6, 2026 08:22
why:
The attaching example accepts a caller’s socket, prints the existing
session name and closes its connection. The Lua integration test checks
that the caller’s server survives.

what:
- The installed-package test clears the caller’s socket setting and
  exercises the example’s private-server path, including cleanup after a
  failure.
why:
The attaching guide needs a Lua example that reads an existing session
and leaves the caller’s server running.

what:
- Record the change under Unreleased.
@tony
tony changed the base branch from master to window-showcase December 6, 2026 14:22
@tony
tony force-pushed the connect-existing-session branch from 20c428d to 60b0252 Compare December 6, 2026 14:23
@tony
tony changed the base branch from window-showcase to master December 6, 2026 14:31
@tony
tony merged commit 6c77d8e into master Dec 6, 2026
13 of 14 checks passed
@tony
tony deleted the connect-existing-session branch December 6, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant