Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

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

struct libtmux-go latest

Running

Running is a command started by Session.Start: a real process, already under way, in a pane of its own. Running.Pane exposes that pane so its output can be streamed with Pane.OpenObservation or typed into with Pane.Writer while the command runs; Running.Wait and Running.Kill wait for and stop it. A line printed with nothing separating it from the command's own exit can race tmux's control-mode notification of it and never reach PaneObservation.Reader; RunResult.Lines from Wait, a plain screen capture rather than that notification stream, always has it.

Source and package
Qualified name
tmux.Running
Package
tmux
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/session_run.go
struct tmux.Running

Members4#

  • Kill method Kill asks the tmux server to send SIGKILL to the process group running the command. It does not wait for the process to stop; call Wait to observe the resulting status or signal.
  • Pane method Pane returns the pane the command runs in, materialized immediately after Start returned. Like any materialized record it does not refresh itself; a call after Wait or Kill may no longer describe a live pane.
  • StreamTo method StreamTo copies what the command prints into destination as it prints it and then reports how it ended, so following a command and collecting its outcome are one blocking call rather than a goroutine the caller writes. It returns exactly what Running.Wait returns and, like Wait, removes the window unless RunOptions.Keep was set. destination is written only by this call, so it needs no synchronization of its own, and Running.Kill may be called from another goroutine while it runs.
  • Wait method Wait blocks until the command exits, on tmux's own wait-for signal backed by a widening liveness check, and reports its exit status and what its terminal showed. It removes the window Start created unless RunOptions.Keep was set. A command whose process tmux never reaps has no outcome to report, and Wait ends with ErrOutcomeUnrecorded rather than the zero status that would make a failed command look successful.
Esc

Type to search.

Reference previewOpen reference