Ref
Ref addresses an existing object, the tmux server, or an object an earlier Plan step will create. This permits forward construction without tmux I/O.
Source and package
- Qualified name
-
tmux.Ref - Package
- tmux
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/plan.go
-
Description#
A Ref to an existing object, such as
Window.ReforPaneRef, is reusable in any number of plans. A Ref a plan method returns for a step is bound to the plan that returned it: a different plan refuses it before it sends anything. The binding is a token the Plan carries, so a copy of a Plan (a plan returned by value) keeps recognizing its own refs. Do not record steps on both a plan and its copy, though: they would number the same steps differently.A Ref from
Window.ReforPane.Refnames the winlink or linked pane the record viewed when Ref was called. A later renumbering or move of that window is not followed, so build the plan from fresh records. A record that cannot name its placement still yields a Ref; an operation that needs the placement then refuses with aPlanErrorinstead of falling back to the bare ID.ServerRefaddresses the server for the operations that document a server scope. The zero Ref is kept as a second spelling of it for those same operations, such asPlan.CmdandPlan.SetEnvironment; any operation that needs an object refuses both with aPlanError.