Repository navigation
Description
Remaining example sources
Server.start now owns a private tmux server and removes it on close. The hosted Java attach example and Kotlin Flow example already start their own servers. The repository programs below still accept a scratch socket and the repository's Kotlin example calls a Java helper. Make those programs runnable from their published dependencies and keep a runnable, reader-owned program on the linked pages. Owned server implementation · Hosted Java example · Hosted Kotlin examples.
Linux QA on November 30, 2026
Two independent public-artifact consumers exercised the owned-server examples after #203. The Kotlin quick start printed kotlin-start and the Scala quick start printed created 2 panes. Each used one private socket and cleaned it up. Across JDKs 25, 26 and 27, a separate Java lifecycle check showed that closing an attached client kept the server alive and closing its owner removed its directory. Those outcomes give the remaining example programs a concrete cleanup check. #5 remains a draft for the supervisor-lent path. Tested Scala quick start · Server ownership API
Proposal
Line numbers are at 9e63b52.
examples/src/main/java/io/github/libtmux/examples/BuildAWorkspace.java:
- L18 and L26:
java BuildAWorkspace.java /tmp/libtmux-java-dev/demo/sandargs.length > 0 ? args[0] : "/tmp/libtmux-java-dev/demo/s". Start the server in the program instead of taking the socket path as an argument;/tmp/libtmux-java-devis this repository's scratch directory. - L29:
/** Separated from {@code main} so the suite can run exactly what a reader runs. */becomes/** Builds the session and returns a description of it. */
examples/src/main/java/io/github/libtmux/examples/ServeTmuxOverMcp.java:
- L21 and L37: the same run line and
/tmp/libtmux-java-dev/demo/sdefault. - L41: the same
Separated from {@code main}comment, becoming/** Serves the tmux server over MCP and returns the names of the tools it offers. */
examples/src/main/kotlin/io/github/libtmux/examples/WatchWithFlow.kt:
- L25 and L29:
java -cp ... io.github.libtmux.examples.WatchWithFlowKt /tmp/libtmux-java-dev/demo/sandargs.getOrElse(0) { "/tmp/libtmux-java-dev/demo/s" }, as above. - L43:
server.sessions().first()assumes a session that a launcher created. The program should create the session it watches. - L56:
WatchPaneOutput.printedLine(seen.toString(), "flowed")calls a helper defined inexamples/src/main/java/io/github/libtmux/examples/WatchPaneOutput.java, so the page's code does not compile on its own. Inline the check.
libtmux-workspace/src/test/java/io/github/libtmux/workspace/WorkspaceBuilderTest.java (a JUnit test; the landing page's workspace panel excerpts it):
- L280:
void theDescribedSessionIsWhatGetsBuilt(Server server)receives its server from the test extension. - L287:
"the first window is renamed, not added alongside the one tmux made"becomes"expected the first window to be renamed".
The same run line, /tmp/libtmux-java-dev/demo/s default and Separated from {@code main} comment are in FindPanesRunning.java, RunACommand.java, WatchPaneOutput.java and WatchWhatChanges.java.
Shared docs work
The shared site chooses the program shown in each panel. Check the pinned sources when changing the setup instructions, workspace panel or capture-pane-output pages. The docs build's supervisor-owned server contract has a separate consumer in libtmux/docs#10 and a separate proposal in #5.
Codex checked the hosted pages, the public API and the repository program entry points for this update.
Activity
[-]Java and Kotlin examples on libtmux.org need an outside tmux server[/-][+]Make the remaining Java and Kotlin example programs own their server[/+]