io.github.libtmux.control.ControlClient.ControlClient
Java
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- io.github.libtmux.control.ControlClient
- Package
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/control/ControlClient.java
-
A tmux client that stays attached and answers one command at a time.
This is what a semicolon group cannot be. tmux discards a group after its first failure, so a client has to infer which command failed; here each request is independent and each reply carries the request number that produced it, so a failure discards nothing behind it and attribution is tmux's own.
Replies arrive in request order, so the writer sends one request at a time and matches its reply by position. A deadline before the writer picks a request writes nothing; a deadline after that point ends the client because the next reply could no longer be attributed safely.
The reader and writer are platform threads. A library does not own the virtual-thread scheduler, and either one unable to run stops the client from making progress. The reader only resolves replies and fills bounded subscription buffers; subscriber code runs on the thread that pulls a value.
Threads.
#sendmay be called from several threads at once: requests queue in the order they arrive and each caller gets its own reply. A subscription is read by one thread at a time.Close it. The client holds an attached tmux client, which is what makes tmux push output to it, and closing is what detaches that client and stops its threads. A client that is forgotten does not hold the JVM open — its threads are daemons — and the attached tmux client exits once the JVM does, because it reads its commands from a pipe that closes with it. Until then it is listed among the session's clients like any other.
Discussed in Control mode vs one-shot · Capture pane output
10 declared, 0 inherited
Members
- attach method Attaches a control client to an existing session.
- send method Runs one command and waits for its reply.
- subscribeEvents method Subscribes to state changes tmux volunteers.
- close method Ends the client, rejecting queued requests and resolving picked requests as uncertain.
- isAlive method Whether the client is still running.
- line method tmux parses a control-mode request as one line, so an argument has to survive its lexer. Single quotes preserve everything except a single quote, which is closed, escaped and reopened.
- subscribeOutput method Subscribes to terminal output tmux pushes.
- unescape method tmux writes a byte it cannot print as a three-digit octal escape.
- unwatch method Stops a watch. tmux reads a name with no colon in it as one to remove.
- watch method Asks tmux to report a format whenever its value changes.