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.

method libtmux-go latest

Running.StreamTo

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.

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

Description#

The stream is what tmux pushed, which is not quite everything: output the command printed before StreamTo opened its observation may or may not be in it, and tmux can drop a line printed with nothing between it and the command's exit. RunResult.Lines is a screen capture rather than a notification stream and remains the authoritative record of what the command showed. Streaming needs a control client, which a Connection-bound value does not have, so it returns ErrConnectionRequiresProcess there before waiting and leaves the command running; Wait alone does not.

tmux command#

The tmux commands behind StreamTo.

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference