tmux

package
v0.0.1-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 27 Imported by: 0

README

tmux

Go Reference

Alpha software. Releases carry an -alpha prerelease tag and the API is not settled. Pin an exact version.

The library. A typed, context-aware tmux API with no runtime dependencies.

$ go get github.com/libtmux/libtmux-go/tmux
import "github.com/libtmux/libtmux-go/tmux"

Guessing a method

Three rules cover most of the surface, so a tmux command usually leads to its Go method without a search.

The name drops the receiver's noun, because the receiver already carries it:

tmux Go
kill-pane Pane.Kill
rename-session Session.Rename
link-window Window.Link
split-window Window.SplitPane

A noun naming a different object always stays, which is why Session.NewWindow and Window.SplitPane keep theirs.

The parameters say what is required. A method takes only a context when the receiver names everything (Window.Kill); typed positional values when every value is required (Session.Rename); and a request value when any field is optional (Pane.Capture).

The result says what changed. A method hands back a freshly materialized record when the command changes which object you are holding or what it looks like. Everything else returns only an error.

The object model

Server is an immutable configuration handle — NewServer starts nothing. Session holds Window views, each holding Pane views.

Returned values are records, not live handles. A Session you hold is what tmux said when you asked. Nothing refreshes behind you; Session.Refresh and its counterparts get you a new one.

server := tmux.NewServer(tmux.ServerOptions{SocketName: "my-app"})

session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "work"})
if err != nil {
	return err
}

name, ok := session.Name()      // from the record, no tmux call
windows, err := session.SearchWindows(ctx, nil)   // asks tmux

session.Windows() returns what the record already holds and never queries; session.SearchWindows(ctx, nil) asks tmux. The naming is the difference.

Options and hooks

Every tmux option and hook has a typed accessor, and the tmux name maps to the Go name by one rule (see "Finding an option or hook" in the package docs):

options, err := session.Options(ctx)
if err != nil {
	return err
}
base, ok := options.BaseIndex()

session, err = session.SetMouse(ctx, true)

For a name outside the catalog, RawOption and SetOption take strings.

Runnable: ../examples/option-hook-editing.

Errors

Failures are classified by what tmux refused, so a missing target and a misspelled option are different checks:

if _, err := server.Session(ctx, id); errors.Is(err, tmux.ErrNotFound) {
	// tmux has no such session
}

A completed tmux command that failed is data, not an error, when you use Server.Cmd: CommandResult.ExitCode carries it. Transport and validation failures are Go errors.

Waiting for a pane

This has its own section in the package documentation, and it is worth reading before writing a poll loop: a shell echoes the command you sent, so searching the screen for what you are waiting for finds your own request. Three approaches, in the order worth reaching for them, are documented under "Waiting for a pane".

Reading further

$ go doc github.com/libtmux/libtmux-go/tmux

The package documentation is the reference and is written to be read start to finish. It covers the task index, method-naming rules, snapshots and identity, the transport modes, plans, engines, filters, and the compatibility window.

tmuxtest/ A real tmux server for your tests
../examples/ Runnable programs
../DESIGN.md Why the surface looks like this
../BENCHMARKS.md What each transport costs

Documentation

Overview

Package tmux provides a typed, context-aware API with tmux 3.2a as its minimum supported version, tested through tmux 3.7b.

The import needs no name: the path ends in the package's own name, which is what supplies the identifier a caller writes.

import "github.com/libtmux/libtmux-go/tmux"

server := tmux.NewServer(tmux.ServerOptions{SocketName: "my-app"})

Where to start

Guessing a method

The surface follows three rules, so a tmux command usually leads to its Go method without a search.

The name drops the receiver's noun, because the receiver already carries it: kill-pane is Pane.Kill, rename-session is Session.Rename, link-window is Window.Link. The noun stays when the command creates an object of the receiver's kind, as in Window.NewWindow, or acts on the receiver's siblings as a group, as in Pane.DisplayPanes. A noun naming a different object is not a repetition and always stays, so Session.NewWindow and Window.SplitPane keep theirs.

The parameters say what is required. A method takes only a context when the receiver names everything, as Window.Kill does; typed positional values when every value is required, as Session.Rename does; a single request value when any field is optional, as Pane.Capture does; and required positional values plus a trailing options value when it has both, as Session.SetOption does. That last shape is why a call that sets no flags still writes an empty options literal: folding the required values into the request would let a caller omit them.

The result says what changed. A method hands back a freshly materialized record when the command changes which object the caller is holding or what it looks like: its identity, its placement, its own extent, whether it is selected, or the process inside it. Session.Rename, Window.Resize, and Pane.Select do; the last takes a request where Window.Select takes only a context, because selecting a pane has optional direction and marking to express and selecting a window has none. Everything else returns only an error, including commands that change fields describing what a record is doing rather than which record it is, such as Pane.CopyMode and Pane.Pipe. Records never refresh in place, so Session.Refresh and its counterparts re-read one when a method returned no record.

Reading the type list

Most of the names in this package belong to a few families, so a reader looking for one type can skip the rest rather than read an alphabetical list. A name ending in Request or Options is a parameter type, reached from a method that takes it rather than looked up on its own; one may be shared, as the option scopes share theirs. A name ending in Values is a generated reader for tmux's formats, options, or hooks, reached through an accessor such as Pane.Formats or Session.Options. A name ending in Error is a failure type, and the sentinels that classify one are package-level variables whose names begin with Err. A name ending in Filter describes a search, and one ending in ID, Kind, or Mode is a typed string or enumeration.

What is left is the object model below, which is where to start.

Object model and lifecycle

A Server is an immutable configuration handle. NewServer records a tmux binary, socket, and process configuration without starting tmux; its zero value targets tmux's default configuration. A Session contains Window winlink views, and each window view contains Pane views. A Client can point at one of those views. Calls that query or change tmux accept a context. Canceling the context stops this library's wait for the command; it does not establish whether a mutation reached tmux.

Returned sessions, windows, panes, and clients are materialized records, not live handles. Changing a local record changes only that copy. Use Server.Snapshot to materialize a hierarchy, Server.Session and its counterparts for canonical live point lookups, or Session.Refresh and its counterparts to obtain a new record.

Identity and snapshots

WindowID and PaneID are stable tmux identifiers, but linked sessions can expose more than one view with the same ID. An exact window view includes its session and index; an exact pane view adds its pane ID. Window.Equal and Pane.Equal deliberately collapse those linked views. ID-only snapshot lookups can therefore report ErrSnapshotAmbiguous; use Snapshot.WindowsByID or Snapshot.PanesByID to inspect every view, and methods such as Session.ResolveActiveWindow and Pane.ResolveWindow for exact linked-view relationships.

A Snapshot is observational rather than transactional. Its relationship accessors never query tmux. They return newly allocated slices containing shallow copies, so changing a returned slice cannot change the snapshot.

A record's own relationship accessors -- Session.Windows, Session.Panes, Window.Panes, and Window.LinkedSessions -- report whether the record carries relations at all, because a record from a targeted lookup does not and an empty result cannot say so. tmux destroys a window when its last pane closes and a session when its last window closes, so neither an empty window nor an empty session exists: no window ever truthfully has no panes, and a range over an empty result would run zero times with nothing to explain it. A record that cannot answer still can through tmux, with Window.SearchPanes and its neighbours.

The graph a record navigates is the whole snapshot it came from, and holding one record keeps all of it reachable. For a program that caches a record rather than re-reading, Session.Refresh and its neighbours return a record materialized on its own, which is also why their relations report false.

Errors and context

Server.Cmd exposes raw tmux results: CommandResult.Stdout provides decoded lines and CommandResult.RawStdout preserves exact tmux stdout bytes. A completed nonzero exit is returned as result data, while execution and validation failures are errors. Pane.CaptureBytes and Server.ShowBufferBytes provide byte-preserving high-level output. These bytes are tmux's output after tmux interprets pane terminal contents. Higher-level operations return classified errors such as CommandError. Hierarchy collection reads answer a failure with the failure: a completed command or transport failure is returned rather than reported as no rows, so an empty collection means the server held nothing. A caller that starts what it does not find recognizes an absent server with ErrNoServer rather than by finding no rows, which a misconfigured socket would produce just as readily. A configured binary that cannot be resolved is caller configuration rather than server state, and is reported as an os/exec.Error recoverable with errors.As. Check sentinels with errors.Is and concrete error values with errors.As.

Absence is not an error. A read that can legitimately find nothing reports that through a bool rather than through err, so the two outcomes stay distinguishable: ok reports whether the value exists, and err reports whether the question could be asked at all. Reads of materialized state return (T, bool) because they never query tmux, as in Pane.Width and Snapshot.SessionByID. Reads that do query tmux return (T, bool, error), as in Server.RawOption, Session.GetEnvironment, and Session.ResolveActivePane: an unset option, an unset variable, and a session with no active pane are all ok == false with a nil error.

Operations can make partial progress. A returned error describes the failed operation only; callers must account for delivery ambiguity and should not assume a package-wide rollback rule.

Control mode

Server.OpenControl starts a persistent attached control-mode process. Its startup context bounds process start, attach framing, and registration but does not own the returned ControlClient. ControlClient.Cmd safely encodes arguments without a shell and serializes concurrent requests. A tmux %error frame remains ControlCommandResult data through its Failed field; local, transport, protocol, and context failures are Go errors.

ControlCommandResult.RawStdout contains the exact control frame payload. tmux versions may render escapes in that payload, so use Pane.CaptureBytes or Server.ShowBufferBytes when the high-level pane or buffer bytes are the required contract. ControlClient.Notifications ranges over what tmux says on its own, and ControlClient.NextNotification reads one; both preserve notification order and decode %output and %extended-output through ControlNotification.Output. Exactly one goroutine may read notifications at a time.

Canceling a command after it is written returns the context error; the client drains that command's reply before sending another. ControlClient.Wait leaves queued notifications available through io.EOF; a terminal reader error follows any earlier queued records. ControlClient.CloseContext and ControlClient.Close reject unaccepted requests and give an accepted command a bounded frame-drain window before stopping the process and releasing the queue. ControlClient.Reconnect creates a new identity and does not replay commands.

Waiting for a pane

Three ways to wait, in the order worth reaching for them.

ControlClient.NextNotification delivers what a pane writes as tmux writes it. Nothing is read back, so nothing starts a tmux process per round, and events arrive in order, which is what makes the shell's echo something to skip past rather than something to tell apart. This is the one to reach for when a program's output is the thing being waited on.

Server.WaitFor waits on tmux's own channel. Append a wait-for signal to a command and block on the channel: the wait ends when the work ends, and nothing is matched against anything. Reach for it when what the command printed does not matter.

Reading the pane in a loop, with Pane.Capture wrapped in Poll, is the fallback. It costs a tmux process per round even on a handle that selected an engine, because a printed capture cannot run over a control connection. It also searches a screen rather than a stream: a shell echoes what Pane.SendKeys typed, so the command text is on screen before the command runs, and searching that screen for a substring matches the request rather than the result. Sending "sleep 1; printf 'ready\n'" and searching for "ready" succeeds within milliseconds while the program answers a second later. Comparing whole lines survives that, because the echoed line carries the surrounding command, but only while the wanted line stands alone: output that arrives with a timestamp or a log level in front of it defeats the comparison and sends a caller back to the substring search that does not work.

Pane.CaptureToFile answers the first of those two costs and not the second. It routes the capture through a tmux buffer and a file instead of tmux's stdout, so a loop on a connected handle starts no process per round; it reads the same screen, so everything above about the echo still holds.

Whichever is used, a pane given its program directly through Session.NewWindow or Window.SplitPane has no shell in it, and so no echo to account for at all.

Choosing a mode

Every command starts a tmux process unless something is turned on. Each of these is one line to turn on, one line to turn off, and independent of the others:

mode        turn it on            cost              reach for it
---------------------------------------------------------------------------
process     nothing, the default  a process each    one-shot commands
control     OpenControlPool       one tmux client   more than a few commands
concurrent  Connections: N        N tmux clients    parallel readers
chained     NewPlan then Run      no records back   builds and layouts
streaming   Notifications         a connection      watching what a pane does

They combine. A plan run on a connected handle is chained and carried over the connection, which is the cheapest of them and still means exactly what the others mean.

Every switch above changes how a command reaches tmux and none changes what it means, which is what makes them safe to flip. One switch is not in the table because it does change meaning: ServerOptions.Unsupported chooses whether a request naming a capability the running tmux lacks is refused or carried out without it. Its default refuses.

A record keeps the handle it was materialized on, so one obtained before a pool was opened keeps starting a tmux process for every command. Its results are unchanged and only its cost differs, so this is reported through WarningHandler as a WarningControlPoolUnused rather than refused. Session.WithServer and its counterparts move a record onto the connected handle in one line, and the session Server.OpenControlPool hands back is already on it.

Concurrency is a size rather than a transport. ControlPoolRequest takes a number of connections and a caller's own goroutines decide what runs at once; each connection carries one tmux command at a time, so N is the number that can be in flight, and each counts as one more tmux client. Raise it for concurrent readers and treat the number as a cost rather than a dial.

Streaming is the one that reads rather than writes. ControlClient.Cmd carries commands while ControlClient.Notifications ranges over what tmux says on its own -- pane output, and the events behind ControlNotification -- so a watcher does not poll:

for notification, err := range client.Notifications(ctx) {
	if err != nil {
		return err
	}
	if pane, output, ok := notification.Output(); ok {
		handle(pane, output)
	}
}

The choice is only ever about cost, never about behavior, and the benchmarks module is what keeps that true: "go -C benchmarks run ." builds the same window every way and prints what each spent, and its test fails if any of them answers the same query differently.

What a transport costs

Three ways exist to reach tmux, and they differ in what they cost outside this program as well as inside it. Speed is the obvious axis and the less important one: the other is what tmux tells everybody else about the session, because a tmux configuration can react to that.

A tmux process per command is the default and is invisible. Nothing about the session changes because this package is driving it, so a configuration keyed on who is attached behaves as though nobody is. It is the slowest option and the only one with no footprint.

A control connection, from Server.OpenControlPool or Server.OpenControl, carries commands without starting processes, and is a tmux client for as long as it is open. It appears in list-clients, counts toward session_attached, fires a client-attached hook, and keeps destroy-unattached from reclaiming the session it attached to. A pool of several connections counts as several clients. This is why the fast path is chosen rather than automatic: a program that connected by default would make session_attached report a person watching a session that nobody is watching.

Pane.CaptureToFile reads a pane without starting a process, by staging through a tmux buffer and a file rather than through the connection, since a printed capture cannot cross one. It costs a path that both tmux and this program can reach, and leaves the file behind.

Code handed a Server can ask which of these its caller chose with Server.Engine, and should leave that choice alone rather than connecting over it.

Sending several commands at once

A Plan is the other axis. It records commands instead of running them, and sends the ones that need no answer to tmux together, as a tmux command list:

plan := tmux.NewPlan()
pane := plan.SplitPane(window.Ref(), tmux.SplitPaneRequest{})
plan.SendKeys(pane, tmux.SendKeysRequest{Command: tmux.Ptr("top")})
result, err := plan.Run(ctx, server)

Each method mirrors the one that runs the same tmux command immediately and takes the same request, so a plan is written the way the same work is written without one. Both render through one builder, which is what stops a flag meaning different things planned and unplanned.

The Ref returned by a recording method is the point. It addresses the pane that split is going to create, before it exists, so a build is written in one pass rather than stopping at each step to learn an ID.

A command this package has no recorder for is still recordable: Plan.Cmd takes raw tmux arguments the way Pane.Cmd does, and a Ref still names what it acts on, so the escape hatch reaches a forward reference too.

Recording touches nothing, so a plan can be read before it is run. Plan.Preview renders what would be sent and Plan.Explain reports how it would be grouped and why each group ends where it does.

Reading it first is worth doing, because a plan is not atomic. tmux has no transaction, so an argument it would refuse at the last step is refused after every step before it has already changed something. Plan.Preview returns that as an error naming the step, and leaves only the steps whose target an earlier step has yet to create rendered as nil.

What cannot be grouped is what tmux cannot report separately. tmux answers a command list with one merged stdout and one status, so an operation that prints something the caller reads, or an ID a later step needs, is sent on its own. Everything else travels together. That also fixes what a failure can say: tmux abandons a list at its first failure, so a plan stops there, and the operations sharing that dispatch cannot be told apart.

What a plan costs is records. A method that runs a command returns the Session, Window, or Pane it changed, and a recorded operation returns an ID and a status, because a plan asks tmux once rather than after every step. Code that reads a record between steps wants the direct API, and is not giving anything up by staying there: a connection is the switch that makes that cheap, and it is a different switch.

A plan helps most on a tmux process, where grouping removes a process per command. Over a control connection there is no process to remove and tmux still answers each command, so the saving is smaller -- the reason to plan there is the forward reference and the single round of results, not speed.

Engines

By default every command in this package starts a tmux process. An Engine is a transport that can carry commands instead, and Server.WithEngine returns a handle that uses one:

client, err := server.OpenControl(ctx, session)
if err != nil {
	return err
}
defer client.Close()
connected := server.WithEngine(client.Engine())

Every operation means the same thing on the returned handle. Only the transport changes, so the code above is the whole difference between forking a tmux process per command and reusing one control-mode connection.

A record carries the handle that produced it, so a session, window, pane, or client obtained before that call keeps starting a tmux process for every command and reports no error while doing so. Pane.WithServer and its counterparts on Session, Window, and Client move one across:

pane = pane.WithServer(connected)

Nothing is read back, because a handle is configuration rather than state: the move is a struct copy, and the relations reached through the moved record come back on the same handle. Server.Session and its counterparts remain the way to obtain a record the caller does not already hold.

One read stays on a process even on a connected handle, and there is a way around it. Pane.Capture and Pane.CaptureBytes promise tmux's own stdout bytes, which a control connection cannot deliver. Pane.CaptureToFile captures into a tmux buffer, saves that buffer to a path both tmux and the caller can reach, and reads it back: three commands that print nothing, in place of one that prints the pane. A loop built on it starts no tmux process per round. On a handle with no engine it is three processes where Pane.Capture is one, so it is a trade a connected handle makes rather than a better capture.

An engine declares which CommandKind values it can carry, and a Server runs the rest as tmux processes through the same ServerOptions.Runner it always used. That is why selecting an engine can never remove an operation: interactive attachment needs a real terminal, tmux -V is a client-global option rather than a command, and Pane.Capture, Pane.CaptureBytes, and Server.ShowBufferBytes promise tmux's own stdout bytes rather than a transport's rendering of a reply. Each of those keeps starting a process on a handle that selected the control-mode engine.

Server.SubprocessEngine is that default as a value, so a handle derived from a connected one can go back to starting processes. ServerOptions.Runner remains the seam that replaces process execution itself, and it stays in effect underneath any engine.

Filters and request values

Generated filter criteria use pointers so false, zero, and empty values stay distinct from an unset field. Ptr returns a distinct pointer to a shallow copy for those criteria. Exact-match constructors such as PaneCommandIs cover common filters without pointer temporaries. Request fields use plain values where zero unambiguously means that tmux should select its default; this includes positive dimensions, counts, adjustments, and stable nominal targets.

Finding an option or hook

tmux names map to Go names mechanically, so a name read from tmux(1) is enough to reach its Go API without scanning a method list.

An option's Go accessor is its tmux name in Go spelling, and its setter is that name prefixed with Set. tmux's bell-action is Session.SetBellAction to write and SessionOptionValues.BellAction to read; main-pane-width is Window.SetMainPaneWidth and WindowOptionValues.MainPaneWidth. Each generated member links to its counterpart, so either half of a pair leads to the other.

The scope tmux documents for an option decides the receiver:

An option tmux accepts at more than one scope has a setter on each receiver, which is how the receiver expresses what a tmux -t target expresses: window-style is Window.SetWindowStyle, GlobalWindowScope.SetWindowStyle, and Pane.SetWindowStyle.

Hooks read the same way through Session.Hooks and its counterparts, and SessionHookValues.ClientAttached names the tmux hook it decodes. Hooks are written by name with Session.SetHook because a hook body is a tmux command rather than a typed value.

Every generated option and hook member quotes its exact tmux spelling in its own documentation. Searching the rendered package documentation, or go doc -all output, for bell-action therefore reaches its setters and its accessor without knowing the Go spelling first.

Options, hooks, and concurrency

Generated typed option and hook values cover known names. Scalar options have direct setters; choice options use named string types whose Valid method recognizes the supported-version union. Server options remain on Server; Server.GlobalSessionScope and Server.GlobalWindowScope select global option and hook scopes before an operation. Server.RawOption, GlobalSessionScope.RawOption, and GlobalSessionScope.RawHook preserve caller-named values outside that catalog. SparseArray preserves array indexes and holes; typed array setters replace the complete local array and return SetArrayResult with confirmed progress. Replacement is ordered but not atomic, so callers must serialize concurrent writes to the same target and option. The receiver's UnsetOption method restores inheritance or the global default. Typed option values report explicit empty bases and inherited origin. Bulk Options and Hooks reads follow the same rule: a transport, completed-command, or version-probe failure is returned rather than answered with zero values, so a decoded empty value means tmux reported one. RawOption and RawHook report a quiet missing name as absent through their ok result, which is where absence belongs, and return every failure. WarningHandler receives compatibility warnings synchronously and may be called concurrently by server operations.

tmux vocabulary and raw fallbacks

Core records expose their own scoped formats with receiver-shortened names: Pane.Active, for example, decodes #{pane_active}. Session.Formats, Window.Formats, Pane.Formats, and Client.Formats expose universal and projected fields through FormatValues using full tmux-token names such as FormatValues.WindowName. All return a typed value with an ok result and perform no tmux I/O. Use FormatValues.Raw when an empty or malformed expansion must remain distinguishable. Generated option and hook accessors likewise name the exact tmux option or hook, its scope, value type, and minimum version. RawOption, RawHook, SetOption, and SetHook are the adjacent escape hatches for caller-named values.

Concurrent use is supported for Server.Cmd, version-cache coordination, read-only snapshots and returned copy boundaries, and immutable values. No broader goroutine-safety guarantee is implied.

API stability

This is alpha software. Releases carry an -alpha prerelease tag, the API is not settled, and any release may change or remove exported identifiers without a deprecation period. Pin an exact version.

Until v1.0.0, a minor release may make a documented breaking API change. Starting with v1, exported identifiers, method signatures, error classification, and documented behavior follow semantic versioning: compatible additions may ship within v1, while removals and incompatible changes require a v2 module path.

Generated exported identifiers follow the same policy as handwritten API. Python parity describes supported behavior, not a permanent name-for-name Go mapping; deliberate language translations and omissions are recorded in the parity manifest. The tmux compatibility range below is independent of the Go API version.

Compatibility

tmux 3.2a is the minimum supported version. A configured socket name or path selects a particular tmux server; absent selectors use tmux's default socket. A request naming a flag the running tmux does not have is refused, naming the capability and both versions. ServerOptions.Unsupported chooses the behavior that omits the flag and reports it to WarningHandler instead; see UnsupportedPolicy for why refusing is the default.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-workflow",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{
		Name: "project", WindowName: "editor",
	})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	windowName := "tests"
	window, err := session.NewWindow(ctx, tmux.NewWindowRequest{
		Name: &windowName, Attach: true,
	})
	if err != nil {
		fmt.Println("create window:", err)
		return
	}
	pane, err := window.SplitPane(ctx, tmux.SplitPaneRequest{
		Direction: tmux.PaneDirectionRight,
	})
	if err != nil {
		fmt.Println("split pane:", err)
		return
	}
	selected, err := pane.Select(ctx, tmux.PaneSelectRequest{})
	if err != nil {
		fmt.Println("select pane:", err)
		return
	}

	// window is the record NewWindow returned, so the panes it carries are the
	// ones it was created with. SearchPanes asks tmux instead, which is what
	// sees the split.
	panes, err := window.SearchPanes(ctx, nil)
	if err != nil {
		fmt.Println("search panes:", err)
		return
	}
	name, _ := window.Name()
	fmt.Println(name, len(panes), selected.ID() == pane.ID())
}
Output:
tests 2 true

Index

Examples

Constants

View Source
const (
	// MinimumSupportedVersion is the oldest tmux feature level supported by this package.
	MinimumSupportedVersion = "3.2a"
	// MaximumTestedVersion is the newest numbered tmux feature level covered by
	// this package's tests. That feature level is tested against tmux 3.7b.
	MaximumTestedVersion = "3.7"
)
View Source
const FilterSchemaVersion = 1

FilterSchemaVersion identifies external metadata for the generated filter JSON wire schema. It is not embedded in JSON and is independent of the tmux Version.

View Source
const ModulePath = "github.com/libtmux/libtmux-go"

ModulePath is the Go module this package belongs to. It is the module path rather than the package path, because that is what Go build metadata records.

Variables

View Source
var (
	// ErrMalformedControlNotification identifies a structurally invalid
	// control-mode notification.
	ErrMalformedControlNotification = errors.New("tmux: malformed control notification")
	// ErrUnknownControlNotification identifies a well-framed notification kind
	// outside the pinned control-mode vocabulary.
	ErrUnknownControlNotification = errors.New("tmux: unknown control notification")
)
View Source
var (
	// ErrInvalidEnvironmentName identifies a name tmux cannot store.
	ErrInvalidEnvironmentName = errors.New("tmux: invalid environment variable name")
	// ErrInvalidEnvironmentValue identifies a value the line-oriented read API cannot round-trip.
	ErrInvalidEnvironmentValue = errors.New("tmux: invalid environment variable value")
	// ErrMalformedEnvironment identifies output that is not a tmux environment entry.
	ErrMalformedEnvironment = errors.New("tmux: malformed environment output")
)
View Source
var (
	// ErrInvalidRequest identifies lifecycle options rejected before execution.
	ErrInvalidRequest = errors.New("tmux: invalid lifecycle request")
	// ErrSessionExists identifies a named session that was not replaced.
	ErrSessionExists = errors.New("tmux: session already exists")
	// ErrInvalidCommandOutput identifies malformed identity output from tmux.
	ErrInvalidCommandOutput = errors.New("tmux: invalid lifecycle command output")
)
View Source
var (
	// ErrOption identifies a failed high-level option or hook operation. It is
	// matched by errors.Is for OptionError.
	ErrOption = errors.New("tmux: option operation failed")
	// ErrUnknownOption identifies tmux's case-sensitive unknown-option diagnostic.
	ErrUnknownOption = fmt.Errorf("%w: unknown option", ErrOption)
	// ErrInvalidOption identifies tmux's case-sensitive invalid-option diagnostic.
	ErrInvalidOption = fmt.Errorf("%w: invalid option", ErrOption)
	// ErrInvalidOptionValue identifies a typed option value outside its active
	// tmux-version domain.
	ErrInvalidOptionValue = fmt.Errorf("%w: invalid option value", ErrOption)
	// ErrAmbiguousOption identifies tmux's case-sensitive ambiguous-option diagnostic.
	ErrAmbiguousOption = fmt.Errorf("%w: ambiguous option", ErrOption)
	// ErrOptionTarget identifies an option or hook operation whose target did
	// not resolve, which is the failure an unknown name is most easily mistaken
	// for. Classifying it discloses nothing that redaction protects: which kind
	// of failure occurred is not one of the values or hook commands an option
	// error withholds.
	ErrOptionTarget = fmt.Errorf("%w: target not found", ErrOption)
)

Option error sentinels classify OptionError through errors.Is.

View Source
var (
	// ErrVersionQuery identifies a tmux version probe that produced no usable
	// version. It is matched by errors.Is for VersionQueryError.
	ErrVersionQuery = errors.New("tmux: version query failed")
	// ErrVersionTooLow identifies a tmux version below a required feature level.
	// It is matched by errors.Is for VersionTooLowError.
	ErrVersionTooLow = errors.New("tmux: version too low")
)

Version-probe sentinels classify VersionQueryError and VersionTooLowError through errors.Is.

View Source
var (
	// ErrMalformedSnapshot identifies invalid required fields in decoded rows.
	// SnapshotDecodeError matches it through errors.Is.
	ErrMalformedSnapshot = errors.New("tmux: malformed snapshot")
	// ErrSnapshotNotFound identifies a point lookup with no matching view.
	// SnapshotLookupError matches it through errors.Is.
	ErrSnapshotNotFound = errors.New("tmux: snapshot object not found")
	// ErrSnapshotAmbiguous identifies a point lookup with multiple matching
	// views. SnapshotLookupError matches it through errors.Is.
	ErrSnapshotAmbiguous = errors.New("tmux: snapshot object is ambiguous")
)

Snapshot error sentinels classify SnapshotDecodeError and SnapshotLookupError through errors.Is.

View Source
var (
	// ErrInvalidSparseIndex identifies a negative or overflowing sparse index.
	ErrInvalidSparseIndex = errors.New("tmux: invalid sparse array index")
	// ErrDuplicateSparseIndex identifies repeated constructor indices.
	ErrDuplicateSparseIndex = errors.New("tmux: duplicate sparse array index")
)
View Source
var (
	// ErrMissingTarget identifies an operation on a zero-value model identity.
	ErrMissingTarget = errors.New("tmux: object target is required")
	// ErrInvalidTarget identifies a malformed stable tmux identifier. It is
	// matched by errors.Is for TargetError.
	ErrInvalidTarget = errors.New("tmux: invalid object target")
)

Target error sentinels classify malformed identities. TargetError matches ErrInvalidTarget through errors.Is.

View Source
var ErrCommand = errors.New("tmux: command failed")

ErrCommand identifies a failed high-level tmux command. It is matched by errors.Is for CommandError.

View Source
var ErrControlClosed = errors.New("tmux: control client is closed")

ErrControlClosed identifies an operation attempted after a control client began closing or lost its protocol stream.

View Source
var ErrControlProtocol = errors.New("tmux: malformed control protocol")

ErrControlProtocol identifies malformed tmux control-mode framing.

View Source
var (
	// ErrInvalidCaptureRequest identifies a capture request that cannot be
	// represented safely as tmux arguments.
	ErrInvalidCaptureRequest = errors.New("tmux: invalid capture request")
)
View Source
var ErrInvalidFilter = errors.New("tmux: invalid filter")

ErrInvalidFilter reports a malformed or impossible generated filter.

View Source
var (
	// ErrInvalidServerCommandRequest identifies a server command request that
	// cannot be represented safely as tmux arguments.
	ErrInvalidServerCommandRequest = errors.New("tmux: invalid server command request")
)
View Source
var (
	// ErrInvalidVersion identifies malformed tmux version tokens. It is matched by
	// errors.Is for VersionError.
	ErrInvalidVersion = errors.New("tmux: invalid version")
)

ErrInvalidVersion classifies VersionError through errors.Is.

View Source
var ErrMalformedComplexOption = errors.New("tmux: malformed complex option")

ErrMalformedComplexOption identifies an invalid entry in a parsed complex option.

View Source
var ErrMalformedFormatOutput = errors.New("tmux: malformed format output")

ErrMalformedFormatOutput identifies invalid escaped tmux format output. It is matched by errors.Is for FormatDecodeError.

View Source
var (
	// ErrMalformedOptionOutput identifies a recognized option or hook record
	// that cannot be decoded without ambiguity. It is matched by errors.Is for
	// OptionDecodeError.
	ErrMalformedOptionOutput = errors.New("tmux: malformed option output")
)

ErrMalformedOptionOutput classifies OptionDecodeError through errors.Is.

View Source
var ErrMissingSubcommand = errors.New("tmux: subcommand is required")

ErrMissingSubcommand identifies an object command with no tmux subcommand.

View Source
var ErrNoServer = errors.New("tmux: no server reached")

ErrNoServer identifies a command that no tmux server answered: either tmux refused it before running it, because it reached no server on the configured socket or would not use the directory that socket lives in, or the server it reached went away before answering. It is matched by errors.Is for CommandError, alongside ErrCommand.

It exists because a tmux server holding no sessions exits, so "nothing is running yet" is ordinary state rather than a fault, and a program that starts what it does not find needs to recognize it:

sessions, err := server.Sessions(ctx)
switch {
case errors.Is(err, tmux.ErrNoServer):
	// nothing is running yet
case err != nil:
	return err
}

It classifies an error and never replaces one. A list that cannot be read reports the failure either way, so a socket that is unreadable, is not a socket, or holds a server this process may not reach is never answered with an empty collection.

It does not separate a server that was never reached from one that has just gone, because a program killing a server and reading from it immediately produces either, depending on whether its client had connected first.

It also does not separate an absent server from one that is present and unreachable, because tmux does not either: client.c treats ECONNREFUSED and ENOENT alike, prints a constant message only for the first, and renders every other errno through strerror, whose text follows the process locale. Matching that text would make the classification locale-dependent, which is worse than declining to draw the line. Acting on this sentinel stays safe regardless: a caller that creates what it did not find gets tmux's own refusal, naming the socket and the reason, rather than a session somewhere unintended. A caller that needs the distinction should inspect the socket itself.

View Source
var ErrNotInsideTmux = errors.New("tmux: not inside tmux")

ErrNotInsideTmux identifies missing or malformed tmux discovery variables.

View Source
var ErrPlan = errors.New("tmux: plan cannot run")

ErrPlan identifies a plan that cannot run as recorded. It is matched by errors.Is for PlanError.

View Source
var ErrPollCondition = errors.New("tmux: poll condition is required")

ErrPollCondition identifies a poll whose condition was nil. It is matched by errors.Is.

View Source
var ErrUnknownColor = errors.New("tmux: unknown color mode")

ErrUnknownColor identifies an unsupported tmux color mode. It is matched by errors.Is for ColorError.

Functions

func PackageVersion

func PackageVersion() (string, bool)

PackageVersion returns the release version recorded in Go build metadata. Development builds and binaries without module metadata return "", false.

func Poll

func Poll(
	ctx context.Context,
	interval time.Duration,
	condition func(context.Context) (bool, error),
) error

Poll checks condition immediately and then after each interval, until it reports true, returns an error, or ctx ends.

tmux accepts keys before the program in a pane has run them, so reading a command's output back is a wait rather than a read. This is that wait. It is not Server.WaitFor, which signals tmux's own wait-for channel between commands and cannot observe what a pane printed.

Poll returns ctx.Err when the context ends first, so a caller bounds the wait by giving ctx a deadline rather than by passing a second timeout. A condition receives ctx and must observe it itself; Poll cannot interrupt one that is already running. Condition errors are returned unchanged.

Example
package main

import (
	"context"
	"fmt"
	"slices"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-poll",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}
	command := "printf 'build ready\\n'"
	if err := pane.SendKeys(ctx, tmux.SendKeysRequest{Command: &command}); err != nil {
		fmt.Println("send keys:", err)
		return
	}

	// tmux accepts the keys before the shell runs them, so the read is a wait.
	// Poll stops when the condition holds or ctx expires, whichever is first.
	//
	// slices.Contains compares whole lines on purpose. The shell echoes the
	// command, so the screen holds printf 'build ready\n' before the program
	// runs; searching that screen for the substring "build ready" would match
	// the echo and report success immediately. The echoed line carries the
	// surrounding command and so never equals the output on its own.
	err = tmux.Poll(ctx, 10*time.Millisecond, func(ctx context.Context) (bool, error) {
		lines, err := pane.Capture(ctx, tmux.CapturePaneRequest{})
		if err != nil {
			return false, err
		}
		return slices.Contains(lines, "build ready"), nil
	})
	if err != nil {
		fmt.Println("wait for output:", err)
		return
	}
	fmt.Println("build ready")
}
Output:
build ready

func Ptr

func Ptr[T any](value T) *T

Ptr returns a pointer to a shallow copy of value. Each call has separate owning storage. Go permits pointers to distinct zero-size values to compare equal; non-zero values have distinct pointer identities. Reference-bearing values such as slices, maps, and pointers still alias their referenced data. Ptr performs no validation and transfers no ownership.

Example
package main

import (
	"fmt"

	"github.com/libtmux/libtmux-go/tmux"
)

func main() {
	value := tmux.Ptr(0)
	fmt.Println(*value)

}
Output:
0

func ValidateSessionName

func ValidateSessionName(name string) error

ValidateSessionName reports whether name can be used as a tmux session name. Empty names, the target delimiters '.' and ':', control characters and invalid UTF-8 are rejected.

Types

type ActivityAction

type ActivityAction string

ActivityAction is a typed value for the "activity-action" tmux option. Its zero value is invalid.

const (
	// ActivityActionNone selects "none".
	ActivityActionNone ActivityAction = "none"
	// ActivityActionAny selects "any".
	ActivityActionAny ActivityAction = "any"
	// ActivityActionCurrent selects "current".
	ActivityActionCurrent ActivityAction = "current"
	// ActivityActionOther selects "other".
	ActivityActionOther ActivityAction = "other"
)

func (ActivityAction) String

func (v ActivityAction) String() string

String returns the exact tmux spelling of v.

func (ActivityAction) Valid

func (v ActivityAction) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type AllowPassthrough

type AllowPassthrough string

AllowPassthrough is a typed value for the "allow-passthrough" tmux option. Its zero value is invalid.

const (
	// AllowPassthroughOff selects "off".
	AllowPassthroughOff AllowPassthrough = "off"
	// AllowPassthroughOn selects "on".
	AllowPassthroughOn AllowPassthrough = "on"
	// AllowPassthroughAll selects "all".
	AllowPassthroughAll AllowPassthrough = "all"
)

func (AllowPassthrough) String

func (v AllowPassthrough) String() string

String returns the exact tmux spelling of v.

func (AllowPassthrough) Valid

func (v AllowPassthrough) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type AttachSessionOptions

type AttachSessionOptions struct {
	// DetachOthers disconnects other clients attached to the target session.
	DetachOthers bool
	// DetachParent detaches the invoking client from its parent session first.
	DetachParent bool
	// NoUpdateEnvironment preserves the invoking client's environment.
	NoUpdateEnvironment bool
	// ReadOnly attaches the client with read-only permissions.
	ReadOnly bool
	// StartDirectory selects the attached client's initial directory.
	StartDirectory *string
	// ClientFlags are comma-joined client flags copied before attachment starts.
	ClientFlags []string
	// Stdin is the attached tmux client's input stream; nil inherits process stdin.
	Stdin *os.File
	// Stdout is the attached tmux client's output stream; nil inherits process stdout.
	Stdout *os.File
	// Stderr is the attached tmux client's error stream; nil inherits process stderr.
	Stderr *os.File
}

AttachSessionOptions configures terminal ownership and attach behavior shared by server- and session-scoped attachment. Nil StartDirectory omits its flag and a nonnil empty string is explicit; ClientFlags is copied. The Stdin, Stdout, and Stderr pointers are retained for the attach call and are never owned or closed by this package.

type AttachSessionRequest

type AttachSessionRequest struct {
	// Target is a session name or tmux target pattern; empty leaves selection to tmux.
	Target string
	// AttachSessionOptions supplies terminal streams and attach flags.
	AttachSessionOptions
}

AttachSessionRequest selects a session name or tmux target pattern and configures a blocking terminal attachment. An empty Target lets tmux choose.

type BellAction

type BellAction string

BellAction is a typed value for the "bell-action" tmux option. Its zero value is invalid.

const (
	// BellActionNone selects "none".
	BellActionNone BellAction = "none"
	// BellActionAny selects "any".
	BellActionAny BellAction = "any"
	// BellActionCurrent selects "current".
	BellActionCurrent BellAction = "current"
	// BellActionOther selects "other".
	BellActionOther BellAction = "other"
)

func (BellAction) String

func (v BellAction) String() string

String returns the exact tmux spelling of v.

func (BellAction) Valid

func (v BellAction) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type BindKeyRequest

type BindKeyRequest struct {
	// Key is the required tmux key notation to bind.
	Key string
	// Command is the tmux command; an empty command is a no-op binding on tmux 3.3+.
	Command string
	// KeyTable selects a table, or nil for tmux's default table.
	KeyTable *string
	// Note supplies tmux's optional binding note.
	Note *string
	// Repeat makes the binding repeatable.
	Repeat bool
}

BindKeyRequest configures one tmux key binding. Its zero value is invalid because Key is required; nil KeyTable and Note omit their flags while pointers to empty strings are explicit.

type BreakPaneRequest

type BreakPaneRequest struct {
	// Attach lets the new winlink become current in the receiver session.
	Attach bool
	// Name requests the new window name; empty normally lets tmux choose.
	Name string
}

BreakPaneRequest configures break-pane on tmux 3.2a or later. Its zero value moves the receiver to a detached new window with tmux's default name, except for the documented raw-version 3.7 workaround in Pane.BreakPane. Empty Name cannot be distinguished from omission. Name is validated before the version probe; request values are copied for the call and retained nowhere.

type CapturePaneRequest

type CapturePaneRequest struct {
	// Start selects the first captured line. Empty uses tmux's visible-screen
	// default; CaptureBoundary selects the start of history.
	Start CapturePosition
	// End selects the last captured line. Empty uses tmux's visible-screen
	// default; CaptureBoundary selects the end of the visible pane.
	End CapturePosition

	// EscapeSequences includes terminal attribute escape sequences.
	EscapeSequences bool
	// EscapeNonPrintable renders non-printable characters as octal escapes.
	EscapeNonPrintable bool
	// JoinWrapped joins wrapped lines, preserves their trailing spaces, and
	// implies tmux trimming independently of TrimTrailing.
	JoinWrapped bool
	// PreserveTrailing preserves trailing spaces at each line end.
	PreserveTrailing bool
	// TrimTrailing omits trailing positions without characters. It requires
	// tmux 3.4; older versions warn and omit the flag.
	TrimTrailing bool
	// AlternateScreen captures the alternate screen without history.
	AlternateScreen bool
	// Quiet suppresses tmux's error when AlternateScreen is requested but no
	// alternate screen exists.
	Quiet bool
	// ModeScreen captures the active mode screen. It requires tmux 3.6; older
	// versions warn and omit the flag.
	ModeScreen bool
	// Pending captures only the beginning of an incomplete escape sequence.
	Pending bool
	// Hyperlinks captures hyperlink metadata for the selected lines. It
	// requires tmux 3.7; older versions warn and omit the flag.
	Hyperlinks bool
	// LineNumbers prefixes each line with its tmux line number. It requires
	// tmux 3.7; older versions warn and omit the flag.
	LineNumbers bool
	// LineFlags prefixes each line with tmux line metadata flags. It requires
	// tmux 3.7; older versions warn and omit the flag.
	LineFlags bool
}

CapturePaneRequest configures pane capture. Its zero value captures the visible screen with tmux's default text handling. Version-gated flags are checked synchronously: unsupported flags are omitted and reported through the server's WarningHandler. CaptureBoundary selects the start of history for Start and the end of the visible pane for End.

type CapturePosition

type CapturePosition string

CapturePosition selects a line relative to tmux's visible pane or history. Its zero value omits the boundary and lets tmux use the visible-screen default. Construct numeric positions with CaptureLine.

const (
	// CaptureBoundary selects the start of history when used as Start and the
	// end of the visible pane when used as End.
	CaptureBoundary CapturePosition = "-"
)

func CaptureLine

func CaptureLine(line int) CapturePosition

CaptureLine returns the canonical tmux representation of a capture line. Zero is the first visible line; negative values address history.

type CaptureRequestError

type CaptureRequestError struct {
	// Field names the invalid request field.
	Field string
	// Value is the rejected field value. It may be empty when absence is the
	// error.
	Value string
	// Reason describes the violated request constraint without promising a
	// stable complete error string.
	Reason string
}

CaptureRequestError reports a CapturePaneRequest field that cannot be represented as a tmux capture-pane argument. It matches ErrInvalidCaptureRequest through errors.Is and is available through errors.As.

func (*CaptureRequestError) Error

func (e *CaptureRequestError) Error() string

Error implements error.

func (*CaptureRequestError) Unwrap

func (e *CaptureRequestError) Unwrap() error

Unwrap makes CaptureRequestError compatible with ErrInvalidCaptureRequest.

type ChooseTreeRequest

type ChooseTreeRequest struct {
	// SessionsCollapsed starts with session nodes collapsed.
	SessionsCollapsed bool
	// WindowsCollapsed starts with window nodes collapsed.
	WindowsCollapsed bool
	// Format is a tmux format expression evaluated for each tree item. Nil
	// leaves the configured format; nonnil empty remains an explicit format.
	Format *string
	// Filter is a tmux format expression whose truth value selects tree items.
	// Nil omits filtering; nonnil empty remains an explicit expression.
	Filter *TmuxFilter
	// Sort selects the initial ordering. Unknown values are rejected before
	// execution.
	Sort TreeSortOrder
	// Reverse reverses the initial tree ordering.
	Reverse bool
	// Zoom zooms the chooser pane while tree mode is active.
	Zoom bool
}

ChooseTreeRequest configures the interactive session and window chooser. Its zero value uses tmux's configured presentation and ordering. Format and Filter are copied before execution; callers retain ownership and must not mutate them concurrently.

type ClearHistoryRequest

type ClearHistoryRequest struct {
	// ResetHyperlinks also removes hyperlinks on tmux 3.4 or newer. Older
	// versions emit a synchronous warning and omit the unsupported flag.
	ResetHyperlinks bool
}

ClearHistoryRequest configures pane history clearing. Its zero value clears scrollback without requesting hyperlink cleanup.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is one materialized tmux client record. It is normally returned by Server.Snapshot, Server.Client, or Client.Refresh. A zero Client is not a usable tmux target.

func (Client) Activity

func (c Client) Activity() (time.Time, bool)

Activity returns a typed time.Time value and an ok result parsed from tmux #{client_activity} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) AttachedPane

func (c Client) AttachedPane() (Pane, bool)

AttachedPane returns the client's exact materialized pane view, if present in the same snapshot. It never queries tmux.

func (Client) AttachedSession

func (c Client) AttachedSession() (Session, bool)

AttachedSession returns the materialized attached session, if present in the same snapshot. It never queries tmux.

func (Client) AttachedWindow

func (c Client) AttachedWindow() (Window, bool)

AttachedWindow returns the client's exact materialized winlink, if present in the same snapshot. It never queries tmux.

func (Client) CellHeight

func (c Client) CellHeight() (int, bool)

CellHeight returns a typed int value and an ok result parsed from tmux #{client_cell_height} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) CellWidth

func (c Client) CellWidth() (int, bool)

CellWidth returns a typed int value and an ok result parsed from tmux #{client_cell_width} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) ControlMode

func (c Client) ControlMode() (bool, bool)

ControlMode returns a typed bool value and an ok result parsed from tmux #{client_control_mode} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Created

func (c Client) Created() (time.Time, bool)

Created returns a typed time.Time value and an ok result parsed from tmux #{client_created} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Discarded

func (c Client) Discarded() (int, bool)

Discarded returns a typed int value and an ok result parsed from tmux #{client_discarded} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Equal

func (c Client) Equal(other Client) bool

Equal reports whether two clients carry the same stable client name.

func (Client) Flags

func (c Client) Flags() (string, bool)

Flags returns a typed string value and an ok result parsed from tmux #{client_flags} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Formats

func (c Client) Formats() FormatValues

Formats returns this Client's read-only materialized tmux format values. It does not query tmux; use Server.Snapshot to obtain a fresh record.

func (Client) Height

func (c Client) Height() (int, bool)

Height returns a typed int value and an ok result parsed from tmux #{client_height} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) KeyTable

func (c Client) KeyTable() (string, bool)

KeyTable returns a typed string value and an ok result parsed from tmux #{client_key_table} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) LastSession

func (c Client) LastSession() (string, bool)

LastSession returns a typed string value and an ok result parsed from tmux #{client_last_session} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) ModeFormat

func (c Client) ModeFormat() (string, bool)

ModeFormat returns a typed string value and an ok result parsed from tmux #{client_mode_format} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Name

func (c Client) Name() ClientName

Name returns the stable tmux name of this client.

func (Client) Prefix

func (c Client) Prefix() (bool, bool)

Prefix returns a typed bool value and an ok result parsed from tmux #{client_prefix} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) ProcessPID

func (c Client) ProcessPID() (int, bool)

ProcessPID returns a typed int value and an ok result parsed from tmux #{client_pid} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) ProcessUID

func (c Client) ProcessUID() (int, bool)

ProcessUID returns a typed int value and an ok result parsed from tmux #{client_uid} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) ProcessUser

func (c Client) ProcessUser() (string, bool)

ProcessUser returns a typed string value and an ok result parsed from tmux #{client_user} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) ReadOnly

func (c Client) ReadOnly() (bool, bool)

ReadOnly returns a typed bool value and an ok result parsed from tmux #{client_readonly} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Refresh

func (c Client) Refresh(ctx context.Context) (Client, error)

Refresh performs a canonical live lookup for the client's stable name and returns a new record without mutating the receiver. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Client) ResolveAttachment

func (c Client) ResolveAttachment(ctx context.Context) (ClientAttachment, error)

ResolveAttachment re-reads the client's live attached hierarchy.

One resolution materializes one strict Snapshot. Snapshot collection is a multi-command observational read, so concurrent tmux changes may produce a partial hierarchy. A missing client, detached client, or stale session returns an empty attachment without an error. Other collection, decoding, and cardinality errors remain visible.

func (Client) Server

func (c Client) Server() Server

Server returns the configured handle that produced the client.

func (Client) Session

func (c Client) Session() (string, bool)

Session returns a typed string value and an ok result parsed from tmux #{client_session} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) String

func (c Client) String() string

String returns the client's stable name.

func (Client) TTY

func (c Client) TTY() (string, bool)

TTY returns a typed string value and an ok result parsed from tmux #{client_tty} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) TermFeatures

func (c Client) TermFeatures() (string, bool)

TermFeatures returns a typed string value and an ok result parsed from tmux #{client_termfeatures} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) TermName

func (c Client) TermName() (string, bool)

TermName returns a typed string value and an ok result parsed from tmux #{client_termname} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) TermType

func (c Client) TermType() (string, bool)

TermType returns a typed string value and an ok result parsed from tmux #{client_termtype} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) UTF8

func (c Client) UTF8() (bool, bool)

UTF8 returns a typed bool value and an ok result parsed from tmux #{client_utf8} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) Width

func (c Client) Width() (int, bool)

Width returns a typed int value and an ok result parsed from tmux #{client_width} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Client) WithServer

func (c Client) WithServer(server Server) Client

WithServer returns a copy of the client whose operations run through server. It is the write half of Client.Server and queries tmux for nothing: a record holds its handle as a plain field, so moving one onto a handle that selected an Engine with Server.WithEngine costs a struct copy rather than a second lookup.

It exists because a record keeps the handle that produced it. One obtained before an engine was selected keeps starting a tmux process for every command and reports no error while doing so, which is the failure this turns into a one-line fix.

Nothing checks that server addresses the same tmux server, because nothing here talks to tmux. A record moved onto a handle with another socket resolves against whatever answers there and reports a missing target at its next command rather than at this call.

Client.AttachedSession, Client.AttachedWindow, and Client.AttachedPane carry the handle of the record they are read from, so one move covers the relations reached through it.

func (Client) Written

func (c Client) Written() (int, bool)

Written returns a typed int value and an ok result parsed from tmux #{client_written} in this Client's materialized client-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Client.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

type ClientAttachment

type ClientAttachment struct {
	// contains filtered or unexported fields
}

ClientAttachment is one immutable view of a client's live attachment. Session, Window, and Pane return values from the same observational Snapshot.

func (ClientAttachment) Pane

func (a ClientAttachment) Pane() (Pane, bool)

Pane returns the attached session's active window's active pane, if present.

func (ClientAttachment) Session

func (a ClientAttachment) Session() (Session, bool)

Session returns the attached session, if it remained live in the snapshot.

func (ClientAttachment) Window

func (a ClientAttachment) Window() (Window, bool)

Window returns the attached session's active winlink, if present.

type ClientFilter

type ClientFilter struct {
	// Name exactly matches the stable tmux client name from Client.Name. A nil pointer leaves Name unset; a non-nil pointer applies it, including when it points to the zero value.
	Name *ClientName `json:"name,omitempty"`
	// NameIn lists accepted values for the stable tmux client name from Client.Name. A candidate matches when its materialized value equals one listed value. A nil slice leaves NameIn unset; a non-nil empty slice is invalid.
	NameIn []ClientName `json:"nameIn,omitempty"`
	// NameContains requires the stable tmux client name from Client.Name to contain the pointed-to substring. A nil pointer leaves NameContains unset; a non-nil pointer applies it, and an empty string matches every available string.
	NameContains *string `json:"nameContains,omitempty"`
	// NameRegex requires the stable tmux client name from Client.Name to match Go regular expression syntax. An empty string leaves NameRegex unset.
	NameRegex string `json:"nameRegex,omitempty"`
	// ReadOnly exactly matches the materialized read-only state from Client.ReadOnly. A nil pointer leaves ReadOnly unset; a non-nil pointer applies it, including when it points to the zero value.
	ReadOnly *bool `json:"readOnly,omitempty"`
	// AnyOf additionally requires at least one branch to match after ordinary criteria match. A nil slice leaves AnyOf unset; a non-nil empty slice is invalid.
	AnyOf []ClientFilter `json:"anyOf,omitempty"`
	// Not excludes a candidate when its nested filter matches. A nil pointer leaves Not unset.
	Not *ClientFilter `json:"not,omitempty"`
	// Session traverses the materialized attachment returned by Client.AttachedSession. A nil pointer leaves the relation criterion unset.
	Session *SessionFilter `json:"session,omitempty"`
	// Window traverses the materialized attachment returned by Client.AttachedWindow. A nil pointer leaves the relation criterion unset.
	Window *WindowFilter `json:"window,omitempty"`
	// Pane traverses the materialized attachment returned by Client.AttachedPane. A nil pointer leaves the relation criterion unset.
	Pane *PaneFilter `json:"pane,omitempty"`
}

ClientFilter evaluates already-materialized Client values and never runs tmux. Its zero value matches every non-nil candidate. Ordinary field and relation criteria are ANDed. AnyOf additionally requires at least one branch to match; Not excludes a match. Field and relation criteria correspond to Client.Name, Client.ReadOnly, Client.AttachedSession, Client.AttachedWindow, and Client.AttachedPane. ClientFilter.Predicate, ClientFilter.MarshalJSON, and ClientFilter.UnmarshalJSON validate automatically. Use ClientFilter.Validate to check a filter constructed directly.

func ClientNameIs

func ClientNameIs(value ClientName) ClientFilter

ClientNameIs returns a ClientFilter that exactly matches the stable tmux client name from Client.Name. It sets no other criteria and does not validate value.

func ClientReadOnlyIs

func ClientReadOnlyIs(value bool) ClientFilter

ClientReadOnlyIs returns a ClientFilter that exactly matches the materialized read-only state from Client.ReadOnly. It sets no other criteria and does not validate value.

func ParseClientLookup

func ParseClientLookup(lookup string, values ...string) (ClientFilter, error)

ParseClientLookup converts a lookup path into a concrete client filter. Paths traverse generated JSON relation names and separate segments with double underscores. The default operator is exact. Accepted suffixes are eq, exact, iexact, contains, icontains, startswith, istartswith, endswith, iendswith, in, nin, regex, and iregex; availability is field-specific. The eq suffix aliases exact, nin negates in, scalar operators require one value, and in and nin require one or more. Invalid paths, operators, values, or results return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (ClientFilter) MarshalJSON

func (filter ClientFilter) MarshalJSON() ([]byte, error)

MarshalJSON validates the client filter and encodes its JSON wire object. FilterSchemaVersion remains external metadata and is not embedded in the object. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (ClientFilter) Predicate

func (filter ClientFilter) Predicate() (func(*Client) bool, error)

Predicate validates the client filter and returns a local predicate accepting Client values already materialized by a Snapshot; it never runs tmux. Relation criteria traverse only relationships already materialized on that candidate. The predicate returns false for a nil candidate. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (*ClientFilter) UnmarshalJSON

func (filter *ClientFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON clears the receiver, then decodes a strict client filter JSON object. FilterSchemaVersion remains external metadata and is not embedded in the object. It rejects unknown or duplicate fields and trailing JSON, then validates decoded criteria. On error, the receiver can retain a partial or complete decoded value. All decode and framing failures and semantic validation failures return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (ClientFilter) Validate

func (filter ClientFilter) Validate() error

Validate checks structure, regular expressions, and contradictory criteria before filter use. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

type ClientName

type ClientName string

ClientName is tmux's stable client name, normally its terminal path. The zero value is not a usable tmux target.

func (ClientName) String

func (name ClientName) String() string

String returns the tmux client name verbatim.

type ClockModeStyle

type ClockModeStyle string

ClockModeStyle is a typed value for the "clock-mode-style" tmux option. Its zero value is invalid.

const (
	// ClockModeStyle12 selects "12".
	ClockModeStyle12 ClockModeStyle = "12"
	// ClockModeStyle24 selects "24".
	ClockModeStyle24 ClockModeStyle = "24"
	// ClockModeStyle12WithSeconds selects "12-with-seconds".
	ClockModeStyle12WithSeconds ClockModeStyle = "12-with-seconds"
	// ClockModeStyle24WithSeconds selects "24-with-seconds".
	ClockModeStyle24WithSeconds ClockModeStyle = "24-with-seconds"
)

func (ClockModeStyle) String

func (v ClockModeStyle) String() string

String returns the exact tmux spelling of v.

func (ClockModeStyle) Valid

func (v ClockModeStyle) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type ColorError

type ColorError struct {
	// Mode is the rejected color-capability override.
	Mode ColorMode
}

ColorError reports an unsupported color mode. It matches ErrUnknownColor through errors.Is; callers can recover Mode with errors.As.

func (*ColorError) Error

func (e *ColorError) Error() string

Error implements error.

func (*ColorError) Unwrap

func (e *ColorError) Unwrap() error

Unwrap makes ColorError compatible with ErrUnknownColor.

type ColorMode

type ColorMode int

ColorMode selects a tmux color-capability override for ServerOptions.

const (
	// ColorDefault preserves tmux's detected color capability.
	ColorDefault ColorMode = 0
	// Color88 requests tmux's 88-color capability mode.
	Color88 ColorMode = 88
	// Color256 requests tmux's 256-color capability mode.
	Color256 ColorMode = 256
)

Supported tmux color-capability overrides.

type CommandAlias

type CommandAlias struct {
	// Name is the alias name.
	Name string
	// Command is the tmux command text associated with Name.
	Command string
}

CommandAlias is one parsed command-alias entry.

type CommandAliases

type CommandAliases struct {
	// contains filtered or unexported fields
}

CommandAliases is an immutable parsed command-alias option. Its zero value is an empty collection: Len is zero, Lookup reports false, and Entries returns a nonnil empty slice.

func (CommandAliases) Entries

func (a CommandAliases) Entries() []CommandAlias

Entries returns a fresh slice in first-definition order.

func (CommandAliases) Len

func (a CommandAliases) Len() int

Len returns the number of distinct aliases.

func (CommandAliases) Lookup

func (a CommandAliases) Lookup(name string) (string, bool)

Lookup returns the command registered for name.

type CommandError

type CommandError struct {
	// Subcommand is the failed tmux subcommand.
	Subcommand string
	// Result is the owned completed result, or an exit-code-only redacted result
	// for a secret-bearing operation.
	Result CommandResult
	// contains filtered or unexported fields
}

CommandError reports a completed failed high-level tmux operation. It matches ErrCommand through errors.Is; callers can recover its fields with errors.As. Generic library operations retain an owned copy of the completed command and output so tmux diagnostics remain available. Operations whose primary payload may contain secrets return an exit-code-only result instead. Callers must treat retained argv and output as potentially sensitive.

func (*CommandError) Error

func (e *CommandError) Error() string

Error implements error.

func (*CommandError) Is

func (e *CommandError) Is(target error) bool

Is reports ErrNoServer for a failure that means no tmux server answered: either the command never reached one, or the one it reached is gone.

func (*CommandError) Unwrap

func (e *CommandError) Unwrap() error

Unwrap makes CommandError compatible with ErrCommand.

type CommandKind

type CommandKind int

CommandKind names what one tmux request needs from the transport that runs it. A Server asks its Engine whether it supports a request's kind and falls back to a tmux process when it does not, so selecting an engine never removes an operation from the API.

An engine must report a kind it does not recognize as unsupported. Later kinds are therefore additive: an engine written before one existed keeps routing it to a tmux process, which is always correct.

const (
	// CommandServer is a tmux command addressed to the configured running
	// server, with its output captured. A transport that serves this kind is
	// already connected to that server, so the request's Arguments hold the tmux
	// command alone, without the configured color, configuration, and socket
	// selectors, and its Stdio is nil. Nearly every operation in this package
	// issues this kind.
	CommandServer CommandKind = iota
	// CommandProcess is a request that needs a tmux process of its own. Its
	// Arguments hold the complete tmux argv including the configured
	// client-global selectors, and its Stdio may stream to caller-owned files.
	// Interactive attachment needs it because a real terminal is the point of
	// the command, and the version probe needs it because tmux -V is a
	// client-global option rather than a command any connected transport can
	// carry.
	CommandProcess
)

func (CommandKind) String

func (k CommandKind) String() string

String implements fmt.Stringer.

type CommandPromptRequest

type CommandPromptRequest struct {
	// Template is the required tmux command template submitted by the prompt.
	Template string
	// Prompt replaces tmux's prompt text when nonnil.
	Prompt *string
	// Inputs supplies initial prompt inputs when nonnil.
	Inputs *string
	// TargetClient selects the stable client that displays the prompt.
	TargetClient ClientName
	// OneKey accepts one key rather than a line.
	OneKey bool
	// KeyOnly limits accepted input to keys.
	KeyOnly bool
	// OnInputChange runs Template after each input change.
	OnInputChange bool
	// Numeric restricts accepted input to a number.
	Numeric bool
	// Type selects the associated prompt-history class; zero omits -T.
	Type PromptType
	// ExpandFormat expands formats in the prompt result.
	ExpandFormat bool
	// Literal disables key-name parsing; tmux before 3.6 refuses it; see UnsupportedPolicy.
	Literal bool
	// BackspaceExit exits on backspace; tmux before 3.7 refuses it; see UnsupportedPolicy.
	BackspaceExit bool
	// NoFreeze leaves the pane unfrozen; tmux before 3.7 refuses it; see UnsupportedPolicy.
	NoFreeze bool
}

CommandPromptRequest configures a background tmux command prompt. Its zero value is invalid because Template is required; nil pointer fields omit flags while explicit empty values are passed to tmux.

type CommandRequest

type CommandRequest struct {
	// Binary is the configured executable. Empty means the default "tmux"
	// executable should be resolved through PATH.
	Binary string
	// Arguments contains the complete tmux argv after global socket, config,
	// and color arguments are applied.
	Arguments []string
	// Environment is the configured child environment. Nil inherits the
	// current process environment.
	Environment []string
	// Directory is the child working directory. Empty inherits the current
	// process working directory.
	Directory string
	// Stdio selects direct streaming. Nil requests captured output; nil files
	// within a non-nil value inherit the corresponding process stream.
	Stdio *CommandStdio
	// CommandList reports that Arguments carries tmux command-list syntax, in
	// which a bare ";" element separates two commands. The zero value is one
	// command whose every element is a value, which is what every typed
	// operation in this package sends.
	//
	// It exists because the two transports parse in opposite directions. A tmux
	// process hands its argv to tmux's outer command parser, which reads a bare
	// ";" as a separator, so a value that ends in one is escaped before it gets
	// there. A control connection has no outer parser and quotes every argument
	// instead, so the same value needs no escape and a separator cannot be
	// written as a quoted argument at all. An engine that ignores this field
	// sends one command with every element quoted, which is correct for the
	// zero value.
	CommandList bool
}

CommandRequest describes one tmux process invocation passed to a CommandRunner. The runner owns Arguments and Environment and may modify them. Stdio retains caller-owned files; neither the runner nor the library closes them.

type CommandResult

type CommandResult struct {
	// Command is the executed tmux argument vector.
	Command []string
	// Stdout contains one decoded standard-output line per element.
	Stdout []string
	// RawStdout contains exact captured standard-output bytes, including line
	// delimiters and trailing newlines. It is nil when no output was captured.
	RawStdout []byte
	// Stderr contains one decoded standard-error line per element.
	Stderr []string
	// ExitCode is tmux's completed process exit code, or -1 when no tmux
	// command ran: this package refused the request, or a transport failed
	// before tmux answered. A negative code is therefore never tmux's opinion
	// of the request, and an error carrying one has a reason of its own.
	ExitCode int
}

CommandResult contains one completed tmux invocation. Server.Cmd returns it even when tmux exits nonzero. Library operations clone its slices before returning it, so the caller owns Command, Stdout, RawStdout, and Stderr.

type CommandRunner

type CommandRunner interface {
	// Run executes one command request.
	Run(context.Context, CommandRequest) (CommandResult, error)
}

CommandRunner executes tmux process requests for a Server. Run may be called concurrently. Completed nonzero exits should remain CommandResult data; execution, transport, and context failures should be returned as errors. Returned slices are copied before they reach the caller.

func SubprocessRunner

func SubprocessRunner() CommandRunner

SubprocessRunner returns the CommandRunner a server uses when ServerOptions.Runner is nil: it runs each request as its own tmux process.

It exists so a Runner can wrap the default rather than replace it. Counting, logging, or failing requests needs only the wrapper, while running them produces the result the rest of the package reads: a nonzero exit is a completed result rather than an error, Stdout holds one decoded line per element with no trailing empty line, and RawStdout holds the exact bytes that the captures promising them return. Delegating keeps all of that correct in a wrapper that does not care about any of it.

Example

ExampleSubprocessRunner counts the requests that become tmux processes, which is how a caller confirms an engine is carrying work. The wrapper delegates execution, so it stays correct without knowing what a result has to look like.

package main

import (
	"context"
	"fmt"
	"sync"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
	defer cancel()

	var mutex sync.Mutex
	var processes int
	counting := tmux.CommandRunnerFunc(func(
		ctx context.Context,
		request tmux.CommandRequest,
	) (tmux.CommandResult, error) {
		mutex.Lock()
		processes++
		mutex.Unlock()
		return tmux.SubprocessRunner().Run(ctx, request)
	})

	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-subprocess-runner",
		Runner:     counting,
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "work"}); err != nil {
		fmt.Println("create session:", err)
		return
	}
	mutex.Lock()
	counted := processes > 0
	mutex.Unlock()
	fmt.Println("requests became processes:", counted)
}
Output:
requests became processes: true

type CommandRunnerFunc

type CommandRunnerFunc func(context.Context, CommandRequest) (CommandResult, error)

CommandRunnerFunc adapts a function to CommandRunner.

func (CommandRunnerFunc) Run

func (function CommandRunnerFunc) Run(
	ctx context.Context,
	request CommandRequest,
) (CommandResult, error)

Run invokes function with ctx and request.

type CommandStdio

type CommandStdio struct {
	// Stdin is the child standard input. Nil inherits os.Stdin.
	Stdin *os.File
	// Stdout is the child standard output. Nil inherits os.Stdout.
	Stdout *os.File
	// Stderr is the child standard error. Nil inherits os.Stderr.
	Stderr *os.File
}

CommandStdio supplies caller-owned files for a streaming CommandRequest.

type ComplexOptionDecodeError

type ComplexOptionDecodeError struct {
	// Option is the option name whose sparse-array entry was malformed.
	Option string
	// Index is the zero-based sparse-array entry index.
	Index int
	// Reason describes the syntax failure without retaining raw option contents.
	Reason string
}

ComplexOptionDecodeError identifies one malformed sparse-array entry without retaining its raw value.

func (*ComplexOptionDecodeError) Error

func (e *ComplexOptionDecodeError) Error() string

Error implements error.

func (*ComplexOptionDecodeError) Unwrap

func (e *ComplexOptionDecodeError) Unwrap() error

Unwrap makes ComplexOptionDecodeError compatible with ErrMalformedComplexOption.

type ConfirmBeforeRequest

type ConfirmBeforeRequest struct {
	// Command is the required tmux command shown for confirmation.
	Command string
	// Prompt replaces tmux's prompt when nonnil.
	Prompt *string
	// ConfirmKey selects the affirmative key; tmux before 3.4 refuses it; see UnsupportedPolicy.
	ConfirmKey *string
	// DefaultYes selects yes by default; tmux before 3.4 refuses it; see UnsupportedPolicy.
	DefaultYes bool
	// TargetClient selects the stable client that displays the prompt.
	TargetClient ClientName
}

ConfirmBeforeRequest configures a background tmux confirmation prompt. Its zero value is invalid because Command is required. Nil pointer fields omit their flags while explicit empty strings are passed to tmux; ConfirmKey must be one printable ASCII character.

type ControlClient

type ControlClient struct {
	// contains filtered or unexported fields
}

ControlClient is one attached tmux control-mode process. Create one with Server.OpenControl. Concurrent Cmd, Wait, and close calls are supported; exactly one caller may execute NextNotification at a time.

func (*ControlClient) ClientName

func (c *ControlClient) ClientName() ClientName

ClientName returns the tmux-assigned identity captured during registration.

func (*ControlClient) Close

func (c *ControlClient) Close() error

Close stops the control process and releases its notification spool. It is safe to call concurrently and more than once.

func (*ControlClient) CloseContext

func (c *ControlClient) CloseContext(ctx context.Context) error

CloseContext starts idempotent control-client shutdown and waits within ctx. An already-ended context does not start shutdown; shutdown continues after a context that ends while waiting, so a later call may retry the wait. Shutdown rejects unaccepted commands and gives an accepted frame a bounded drain window before process-stop escalation.

func (*ControlClient) Cmd

func (c *ControlClient) Cmd(
	ctx context.Context,
	args ...string,
) (ControlCommandResult, error)

Cmd executes one safely encoded tmux command through the control client. A %error frame is returned as ControlCommandResult with Failed set. If ctx ends after the command is written, Cmd returns the context error while the client drains that reply before writing a later command. Closing rejects an unaccepted request and gives an accepted request a bounded drain window.

func (*ControlClient) Engine

func (c *ControlClient) Engine() Engine

Engine returns an Engine that carries tmux commands over the receiver's persistent control-mode connection instead of starting a tmux process for each one. Pass it to Server.WithEngine to make the object API use it:

client, err := server.OpenControl(ctx, session)
if err != nil {
	return err
}
defer client.Close()
connected := server.WithEngine(client.Engine())

The engine borrows the client rather than owning it: ControlClient.Close stops the underlying process, and commands issued afterwards report ErrControlClosed as transport failures, which reach the caller rather than reading as a tmux server holding nothing.

It supports CommandServer only. Interactive attachment and the tmux -V version probe need their own process and keep starting one, as do the reads whose documented result is tmux's exact stdout bytes: Pane.Capture, Pane.CaptureBytes, and Server.ShowBufferBytes preserve tmux's process output, while ControlCommandResult.RawStdout preserves tmux's control rendering of a reply, and this package does not translate one into the other.

A tmux %error frame becomes exit status 1 with the tmux message in CommandResult.Stderr, which is what the same failure looks like through a tmux process, so CommandError and its missing-target classification behave identically through either transport. Control mode has no separate error stream, so a command that succeeds while writing a diagnostic reports empty Stderr here and a nonempty one through a process.

ControlClient.Cmd serializes concurrent requests, so concurrent callers of a Server holding this engine see one in-flight tmux command at a time.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-client-engine",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	client, err := server.OpenControl(ctx, session)
	if err != nil {
		fmt.Println("open control:", err)
		return
	}
	defer func() { _ = client.Close() }()

	// The engine borrows the client; closing the client stops the process, and
	// SubprocessEngine returns a handle to starting one per command again.
	connected := server.WithEngine(client.Engine())
	forking := connected.WithEngine(server.SubprocessEngine())

	for _, handle := range []tmux.Server{connected, forking} {
		sessions, err := handle.Sessions(ctx)
		if err != nil {
			fmt.Println("list sessions:", err)
			return
		}
		fmt.Println(len(sessions))
	}
}
Output:
1
1

func (*ControlClient) NextNotification

func (c *ControlClient) NextNotification(
	ctx context.Context,
) (ControlNotification, error)

NextNotification returns the next ordered control-mode notification. Exactly one caller may execute it at a time. Natural process exit preserves queued notifications until they drain through io.EOF; Close releases the queue and makes subsequent reads report os.ErrClosed. A terminal reader error follows notifications queued before that failure.

Example

ExampleControlClient_NextNotification waits for a pane's output without reading the pane. tmux sends what a pane writes as it is written, so nothing polls, nothing forks a tmux process per round, and no screen is searched.

The window runs the program directly instead of typing it into a shell, so there is no echoed command line to tell apart from the program's own output.

package main

import (
	"bytes"
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-output-events",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "stream"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	control, err := server.OpenControl(ctx, session)
	if err != nil {
		fmt.Println("open control:", err)
		return
	}
	defer func() { _ = control.Close() }()

	window, err := session.NewWindow(ctx, tmux.NewWindowRequest{
		Command: "sh -c 'sleep 1; printf \"service ready\\n\"; sleep 60'",
	})
	if err != nil {
		fmt.Println("create window:", err)
		return
	}
	pane, ok, err := window.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}

	var written []byte
	for !bytes.Contains(written, []byte("service ready")) {
		notification, err := control.NextNotification(ctx)
		if err != nil {
			fmt.Println("wait for output:", err)
			return
		}
		id, data, isOutput := notification.Output()
		if isOutput && id == pane.ID() {
			written = append(written, data...)
		}
	}
	fmt.Println("the pane reported it was ready")
}
Output:
the pane reported it was ready

func (*ControlClient) Notifications

func (c *ControlClient) Notifications(
	ctx context.Context,
) iter.Seq2[ControlNotification, error]

Notifications returns an iterator over what tmux says without being asked: pane output, and the events behind ControlNotification.

It is ControlClient.NextNotification as a range loop, and carries that method's rule that exactly one of them may run at a time.

for notification, err := range client.Notifications(ctx) {
	if err != nil {
		return err
	}
	if pane, output, ok := notification.Output(); ok {
		handle(pane, output)
	}
}

A record this package could not read yields its error and the loop continues, because one unreadable notification is not the end of anything: a tmux newer than this package sends kinds it does not know, and a watcher that stopped at the first would be useless. Those are the errors matching ErrMalformedControlNotification and ErrUnknownControlNotification. Every other error ended the stream, and is the last thing the loop yields.

A tmux that exited on its own drains what it had already sent and then ends the loop with no error at all, because reaching the end of a stream is not a failure. A loop that ends silently is one tmux finished.

Leaving the loop early leaves the rest of the queue where it is rather than dropping it, so a later loop, or a direct call to ControlClient.NextNotification, resumes from the same place.

func (*ControlClient) Reconnect

func (c *ControlClient) Reconnect(ctx context.Context) (*ControlClient, error)

Reconnect closes the receiver and starts a new control client for the same server and session. It returns a new identity and never replays commands.

func (*ControlClient) Server

func (c *ControlClient) Server() Server

Server returns the server handle used to start the control client.

func (*ControlClient) Session

func (c *ControlClient) Session() Session

Session returns the materialized session selected during startup.

func (*ControlClient) Wait

func (c *ControlClient) Wait(ctx context.Context) error

Wait blocks until the control process exits or ctx ends. It does not close the notification spool; callers may drain final notifications before Close.

type ControlCommandResult

type ControlCommandResult struct {
	// Command is the safely encoded command's original argument vector.
	Command []string
	// RawStdout contains exact frame payload bytes, including each line's LF.
	RawStdout []byte
	// Timestamp is tmux's frame timestamp in Unix seconds.
	Timestamp int64
	// Number is tmux's command number for the frame. tmux counts commands the
	// server processed rather than commands this client sent, so a command from
	// any other client advances it too and the gap between two frames is not a
	// count of this client's work.
	Number uint64
	// Flags contains tmux's frame flags.
	Flags int
	// Failed reports whether tmux closed the frame with %error instead of %end.
	Failed bool
}

ControlCommandResult is one completed control-mode command frame. A failed tmux command remains result data through Failed; local, protocol, transport, and context failures are returned separately by ControlClient.Cmd. All slices are owned by the caller.

type ControlNotification

type ControlNotification struct {
	// contains filtered or unexported fields
}

ControlNotification is an immutable parsed tmux control-mode notification. Its zero value has an empty kind and no arguments. Values returned by ParseControlNotification own copied arguments and are safe to retain.

func ParseControlNotification

func ParseControlNotification(line []byte) (ControlNotification, error)

ParseControlNotification parses one newline-free tmux control-mode notification record. It requires exact control framing and a supported kind, returns errors compatible with ErrMalformedControlNotification or ErrUnknownControlNotification, and copies all caller-owned input before returning. It never returns a partial notification.

func (ControlNotification) Arguments

func (n ControlNotification) Arguments() []string

Arguments returns an owned copy of the notification arguments. Arguments before a documented free-form tail are individual values; the tail is the final value and preserves its spacing and tmux escaping.

func (ControlNotification) Kind

Kind returns the notification's protocol kind.

func (ControlNotification) Output

func (n ControlNotification) Output() (PaneID, []byte, bool)

Output returns the pane identity and decoded caller-owned bytes carried by an output or extended-output notification. Other notification kinds return zero values and false.

type ControlNotificationError

type ControlNotificationError struct {
	// Offset is the byte offset of the malformed protocol element.
	Offset int
	// Reason describes the framing or vocabulary error without retaining input.
	Reason string
	// Category is ErrMalformedControlNotification or ErrUnknownControlNotification.
	Category error
}

ControlNotificationError reports where a control-mode notification failed validation without retaining or disclosing the notification contents. Callers can use errors.Is with Category or errors.As to inspect its secret-safe location metadata. Category is ErrMalformedControlNotification or ErrUnknownControlNotification.

func (*ControlNotificationError) Error

func (e *ControlNotificationError) Error() string

Error implements error.

func (*ControlNotificationError) Unwrap

func (e *ControlNotificationError) Unwrap() error

Unwrap makes ControlNotificationError compatible with its Category.

type ControlNotificationKind

type ControlNotificationKind string

ControlNotificationKind identifies a tmux control-mode notification record. Its zero value is unknown and is not emitted by tmux. ParseControlNotification returns known values for the pinned wire vocabulary and rejects unknown notification records.

const (
	// ControlNotificationClientDetached identifies the %client-detached notification, available since tmux 3.2a. Its wire grammar is %client-detached <client>.
	// ParseControlNotification returns its arguments as client tail.
	ControlNotificationClientDetached ControlNotificationKind = "%client-detached"
	// ControlNotificationClientSessionChanged identifies the %client-session-changed notification, available since tmux 3.2a. Its wire grammar is %client-session-changed <client> <session ID> <session name>.
	// ParseControlNotification returns its arguments as client, session ID, session name tail.
	ControlNotificationClientSessionChanged ControlNotificationKind = "%client-session-changed"
	// ControlNotificationConfigError identifies the %config-error notification, available since tmux 3.4. Its wire grammar is %config-error <text>.
	// ParseControlNotification returns its arguments as text tail.
	ControlNotificationConfigError ControlNotificationKind = "%config-error"
	// ControlNotificationContinue identifies the %continue notification, available since tmux 3.2a. Its wire grammar is %continue <pane ID>.
	// ParseControlNotification returns its arguments as pane ID.
	ControlNotificationContinue ControlNotificationKind = "%continue"
	// ControlNotificationExit identifies the %exit notification, available since tmux 3.2a. Its wire grammar is %exit or %exit <reason>.
	// ParseControlNotification returns its arguments as reason tail.
	ControlNotificationExit ControlNotificationKind = "%exit"
	// ControlNotificationExtendedOutput identifies the %extended-output notification, available since tmux 3.2a. Its wire grammar is %extended-output <pane ID> <age> { zero or more <reserved argument> } : <data>.
	// ParseControlNotification returns its arguments as the prefix arguments, then zero or more reserved arguments, then the data tail; the prefix arguments are pane ID, age.
	// Its tail may be empty.
	ControlNotificationExtendedOutput ControlNotificationKind = "%extended-output"
	// ControlNotificationLayoutChange identifies the %layout-change notification, available since tmux 3.2a. Its wire grammar is %layout-change <window ID> <layout> <visible layout> <flags>.
	// ParseControlNotification returns its arguments as window ID, layout, visible layout, flags tail.
	// Its tail may be empty.
	ControlNotificationLayoutChange ControlNotificationKind = "%layout-change"
	// ControlNotificationMessage identifies the %message notification, available since tmux 3.4. Its wire grammar is %message <text>.
	// ParseControlNotification returns its arguments as text tail.
	// Its tail may be empty.
	ControlNotificationMessage ControlNotificationKind = "%message"
	// ControlNotificationOutput identifies the %output notification, available since tmux 3.2a. Its wire grammar is %output <pane ID> <data>.
	// ParseControlNotification returns its arguments as pane ID, data tail.
	// Its tail may be empty.
	ControlNotificationOutput ControlNotificationKind = "%output"
	// ControlNotificationPaneModeChanged identifies the %pane-mode-changed notification, available since tmux 3.2a. Its wire grammar is %pane-mode-changed <pane ID>.
	// ParseControlNotification returns its arguments as pane ID.
	ControlNotificationPaneModeChanged ControlNotificationKind = "%pane-mode-changed"
	// ControlNotificationPasteBufferChanged identifies the %paste-buffer-changed notification, available since tmux 3.4. Its wire grammar is %paste-buffer-changed <name>.
	// ParseControlNotification returns its arguments as name tail.
	ControlNotificationPasteBufferChanged ControlNotificationKind = "%paste-buffer-changed"
	// ControlNotificationPasteBufferDeleted identifies the %paste-buffer-deleted notification, available since tmux 3.4. Its wire grammar is %paste-buffer-deleted <name>.
	// ParseControlNotification returns its arguments as name tail.
	ControlNotificationPasteBufferDeleted ControlNotificationKind = "%paste-buffer-deleted"
	// ControlNotificationPause identifies the %pause notification, available since tmux 3.2a. Its wire grammar is %pause <pane ID>.
	// ParseControlNotification returns its arguments as pane ID.
	ControlNotificationPause ControlNotificationKind = "%pause"
	// ControlNotificationSessionChanged identifies the %session-changed notification, available since tmux 3.2a. Its wire grammar is %session-changed <session ID> <session name>.
	// ParseControlNotification returns its arguments as session ID, session name tail.
	ControlNotificationSessionChanged ControlNotificationKind = "%session-changed"
	// ControlNotificationSessionRenamed identifies the %session-renamed notification, available since tmux 3.2a. Its wire grammar is %session-renamed <session ID> <session name>.
	// ParseControlNotification returns its arguments as session ID, session name tail.
	ControlNotificationSessionRenamed ControlNotificationKind = "%session-renamed"
	// ControlNotificationSessionWindowChanged identifies the %session-window-changed notification, available since tmux 3.2a. Its wire grammar is %session-window-changed <session ID> <window ID>.
	// ParseControlNotification returns its arguments as session ID, window ID.
	ControlNotificationSessionWindowChanged ControlNotificationKind = "%session-window-changed"
	// ControlNotificationSessionsChanged identifies the %sessions-changed notification, available since tmux 3.2a. Its wire grammar is %sessions-changed.
	// ParseControlNotification returns its arguments as no arguments.
	ControlNotificationSessionsChanged ControlNotificationKind = "%sessions-changed"
	// ControlNotificationSubscriptionChanged identifies the %subscription-changed notification, available since tmux 3.2a. Its wire grammar is %subscription-changed <name> <session ID> <window ID> <window index> <pane ID> { zero or more <reserved argument> } : <value>.
	// ParseControlNotification returns its arguments as the prefix arguments, then zero or more reserved arguments, then the value tail; the prefix arguments are name, session ID, window ID, window index, pane ID.
	// Its tail may be empty.
	ControlNotificationSubscriptionChanged ControlNotificationKind = "%subscription-changed"
	// ControlNotificationUnlinkedWindowAdd identifies the %unlinked-window-add notification, available since tmux 3.2a. Its wire grammar is %unlinked-window-add <window ID>.
	// ParseControlNotification returns its arguments as window ID.
	ControlNotificationUnlinkedWindowAdd ControlNotificationKind = "%unlinked-window-add"
	// ControlNotificationUnlinkedWindowClose identifies the %unlinked-window-close notification, available since tmux 3.2a. Its wire grammar is %unlinked-window-close <window ID>.
	// ParseControlNotification returns its arguments as window ID.
	ControlNotificationUnlinkedWindowClose ControlNotificationKind = "%unlinked-window-close"
	// ControlNotificationUnlinkedWindowRenamed identifies the %unlinked-window-renamed notification, available since tmux 3.2a. Its wire grammar is %unlinked-window-renamed <window ID> <name>.
	// ParseControlNotification returns its arguments as window ID, name tail.
	ControlNotificationUnlinkedWindowRenamed ControlNotificationKind = "%unlinked-window-renamed"
	// ControlNotificationWindowAdd identifies the %window-add notification, available since tmux 3.2a. Its wire grammar is %window-add <window ID>.
	// ParseControlNotification returns its arguments as window ID.
	ControlNotificationWindowAdd ControlNotificationKind = "%window-add"
	// ControlNotificationWindowClose identifies the %window-close notification, available since tmux 3.2a. Its wire grammar is %window-close <window ID>.
	// ParseControlNotification returns its arguments as window ID.
	ControlNotificationWindowClose ControlNotificationKind = "%window-close"
	// ControlNotificationWindowPaneChanged identifies the %window-pane-changed notification, available since tmux 3.2a. Its wire grammar is %window-pane-changed <window ID> <pane ID>.
	// ParseControlNotification returns its arguments as window ID, pane ID.
	ControlNotificationWindowPaneChanged ControlNotificationKind = "%window-pane-changed"
	// ControlNotificationWindowRenamed identifies the %window-renamed notification, available since tmux 3.2a. Its wire grammar is %window-renamed <window ID> <name>.
	// ParseControlNotification returns its arguments as window ID, name tail.
	ControlNotificationWindowRenamed ControlNotificationKind = "%window-renamed"
)

func (ControlNotificationKind) MinimumVersion

func (k ControlNotificationKind) MinimumVersion() (Version, bool)

MinimumVersion returns the oldest Version that emits k. It returns ok == false for the zero value and unknown kinds.

type ControlPool

type ControlPool struct {
	// contains filtered or unexported fields
}

ControlPool owns the control-mode connections behind a connected Server and hands one to each command that needs it.

It is the value that closes what Server.OpenControlPool opened. A pool is separate from the handle for the reason Engine gives for owning no shutdown: a Server is copied into every record it produces, so shutdown cannot belong to it. Close the pool when the program is done with the tmux server; commands issued afterwards report ErrControlClosed as transport failures, which reach the caller rather than reading as a tmux server holding nothing.

More than one connection is worth owning only for concurrent callers, since a single connection carries one tmux command at a time. A pool hands each command a connection no other command is using and returns it afterwards, so concurrency is bounded by the number of connections rather than by the library.

A pool carries commands and nothing else. It exposes no notification stream: which connection carried which command is not a caller-visible property, so a pooled connection's notifications are not a sequence a caller could reason about. Open a control client of your own with Server.OpenControl to watch tmux as it changes.

Every method is safe for concurrent use.

func (*ControlPool) Close

func (p *ControlPool) Close() error

Close stops every connection on a bounded context of its own. It is safe to call concurrently and more than once, so it suits defer.

func (*ControlPool) CloseContext

func (p *ControlPool) CloseContext(ctx context.Context) error

CloseContext stops every connection and waits within ctx. It is idempotent and retryable for the reason ControlClient.CloseContext is: a context that ends while waiting abandons the wait rather than the shutdown, so a later call resumes waiting for the same processes.

func (*ControlPool) Connections

func (p *ControlPool) Connections() int

Connections reports how many of the pool's connections can still carry a command. It starts at [ConnectOptions.Connections] and falls as connections fail, so a supervisor can notice a pool degrading before it reaches zero and every command starts failing.

func (*ControlPool) Engine

func (p *ControlPool) Engine() Engine

Engine returns the Engine the connected handle already carries. It is the seam for a second handle that was built elsewhere, such as one from NewServerFromEnv: passing it to Server.WithEngine moves that handle onto these connections. Records obtained from the other handle before the call keep starting tmux processes, so look them up again through the result.

func (*ControlPool) Session

func (p *ControlPool) Session() Session

Session returns the attached session on the connected handle, which is the same value Server.OpenControlPool returned. Reading it here rather than keeping the session that was passed in is what a caller wants: the one passed in still starts a tmux process per command.

type ControlPoolRequest

type ControlPoolRequest struct {
	// Connections is how many control-mode connections the pool owns. Zero
	// opens one, which is all a program that issues commands from a single
	// goroutine can use: ControlClient.Cmd serializes, so one connection
	// carries one tmux command at a time.
	//
	// A tmux command that blocks inside tmux holds its connection for as long
	// as it blocks: a wait on a tmux channel, and the prompting commands,
	// occupy one until they are answered. Enough of them at once
	// leaves nothing to carry the next command, which then waits for a
	// connection rather than for tmux and reports whatever the caller's
	// context reports. Run those on a handle with no engine instead.
	//
	// Raise it only for concurrent callers, and treat the number as a cost
	// rather than a tuning dial. Each connection is an attached tmux process
	// that appears in list-clients output, participates in
	// destroy-unattached and session-attached behavior, and receives its own
	// copy of every notification tmux broadcasts to the session.
	Connections int
}

ControlPoolRequest configures the control-mode connections a pool owns. Its zero value opens one, which is what a caller writes when the only goal is to stop starting a tmux process per command.

type ControlProtocolError

type ControlProtocolError struct {
	// State is the parser state in which the violation occurred.
	State string
	// Reason describes the structural violation without quoting input.
	Reason string
}

ControlProtocolError reports a control-stream state violation without retaining or disclosing command output or notification contents. It matches ErrControlProtocol through errors.Is.

func (*ControlProtocolError) Error

func (e *ControlProtocolError) Error() string

Error implements error.

func (*ControlProtocolError) Unwrap

func (e *ControlProtocolError) Unwrap() error

Unwrap makes ControlProtocolError compatible with ErrControlProtocol.

type CopyModeLineNumbers

type CopyModeLineNumbers string

CopyModeLineNumbers is a typed value for the "copy-mode-line-numbers" tmux option. Its zero value is invalid.

const (
	// CopyModeLineNumbersOff selects "off".
	CopyModeLineNumbersOff CopyModeLineNumbers = "off"
	// CopyModeLineNumbersDefault selects "default".
	CopyModeLineNumbersDefault CopyModeLineNumbers = "default"
	// CopyModeLineNumbersAbsolute selects "absolute".
	CopyModeLineNumbersAbsolute CopyModeLineNumbers = "absolute"
	// CopyModeLineNumbersRelative selects "relative".
	CopyModeLineNumbersRelative CopyModeLineNumbers = "relative"
	// CopyModeLineNumbersHybrid selects "hybrid".
	CopyModeLineNumbersHybrid CopyModeLineNumbers = "hybrid"
)

func (CopyModeLineNumbers) String

func (v CopyModeLineNumbers) String() string

String returns the exact tmux spelling of v.

func (CopyModeLineNumbers) Valid

func (v CopyModeLineNumbers) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type CopyModeRequest

type CopyModeRequest struct {
	// ScrollUp enters copy mode one page above the current position.
	ScrollUp bool
	// ExitOnBottom makes copy mode exit after scrolling back to the visible
	// screen, until another non-scrolling key disables that behavior.
	ExitOnBottom bool
	// MouseDrag begins a copy-mode mouse drag and is meaningful from a mouse
	// binding.
	MouseDrag bool
	// PageDown enters copy mode one page below the current position. It requires
	// tmux 3.5; older versions warn and omit the flag. Its version probe still
	// occurs when Cancel is set.
	PageDown bool
	// SourcePane selects a stable pane whose content is copied while the
	// receiver remains the pane placed in copy mode. Zero uses the receiver. A
	// nonzero value is validated by the library and resolved by tmux even when
	// Cancel is set; a stale or nonexistent pane can prevent cancellation.
	SourcePane PaneID
	// Cancel exits copy mode and any other active pane mode after tmux resolves
	// the receiver and optional SourcePane. A resolution failure prevents the
	// reset; after successful resolution, tmux ignores the other action fields.
	Cancel bool
}

CopyModeRequest configures tmux copy mode. Its zero value enters copy mode on the receiver without scrolling. Fields may be combined. tmux resolves the receiver and optional SourcePane before processing Cancel, so a stale target can fail the request without resetting any mode. After successful resolution, Cancel resets the pane's modes and returns before ScrollUp, ExitOnBottom, MouseDrag, or PageDown has an effect. The library still validates SourcePane and, when PageDown is true, probes the tmux version before invoking copy-mode. SourcePane is a value and is not retained.

type CursorStyle

type CursorStyle string

CursorStyle is a typed value for the "cursor-style" tmux option. Its zero value is invalid.

const (
	// CursorStyleDefault selects "default".
	CursorStyleDefault CursorStyle = "default"
	// CursorStyleBlinkingBlock selects "blinking-block".
	CursorStyleBlinkingBlock CursorStyle = "blinking-block"
	// CursorStyleBlock selects "block".
	CursorStyleBlock CursorStyle = "block"
	// CursorStyleBlinkingUnderline selects "blinking-underline".
	CursorStyleBlinkingUnderline CursorStyle = "blinking-underline"
	// CursorStyleUnderline selects "underline".
	CursorStyleUnderline CursorStyle = "underline"
	// CursorStyleBlinkingBar selects "blinking-bar".
	CursorStyleBlinkingBar CursorStyle = "blinking-bar"
	// CursorStyleBar selects "bar".
	CursorStyleBar CursorStyle = "bar"
)

func (CursorStyle) String

func (v CursorStyle) String() string

String returns the exact tmux spelling of v.

func (CursorStyle) Valid

func (v CursorStyle) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type DestroyUnattached

type DestroyUnattached string

DestroyUnattached is a typed value for the "destroy-unattached" tmux option. Its zero value is invalid.

const (
	// DestroyUnattachedOff selects "off".
	DestroyUnattachedOff DestroyUnattached = "off"
	// DestroyUnattachedOn selects "on".
	DestroyUnattachedOn DestroyUnattached = "on"
	// DestroyUnattachedKeepLast selects "keep-last".
	DestroyUnattachedKeepLast DestroyUnattached = "keep-last"
	// DestroyUnattachedKeepGroup selects "keep-group".
	DestroyUnattachedKeepGroup DestroyUnattached = "keep-group"
)

func (DestroyUnattached) String

func (v DestroyUnattached) String() string

String returns the exact tmux spelling of v.

func (DestroyUnattached) Valid

func (v DestroyUnattached) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type DetachAllClientsRequest

type DetachAllClientsRequest struct {
	// KeepClient selects the stable client to retain; zero keeps tmux's current client.
	KeepClient ClientName
	// ShellCommand is run after detaching when nonnil.
	ShellCommand *string
}

DetachAllClientsRequest configures detaching every client except one. Its zero value keeps tmux's current client; nil fields omit their flags.

type DetachClientRequest

type DetachClientRequest struct {
	// TargetClient selects a stable client; zero selects tmux's current client.
	TargetClient ClientName
	// ShellCommand is run after detaching when nonnil.
	ShellCommand *string
}

DetachClientRequest configures detaching one tmux client. Its zero value detaches tmux's current client; nil fields omit their flags while an empty ShellCommand pointer is explicit.

type DetachOnDestroy

type DetachOnDestroy string

DetachOnDestroy is a typed value for the "detach-on-destroy" tmux option. Its zero value is invalid.

const (
	// DetachOnDestroyOff selects "off".
	DetachOnDestroyOff DetachOnDestroy = "off"
	// DetachOnDestroyOn selects "on".
	DetachOnDestroyOn DetachOnDestroy = "on"
	// DetachOnDestroyNoDetached selects "no-detached".
	DetachOnDestroyNoDetached DetachOnDestroy = "no-detached"
	// DetachOnDestroyPrevious selects "previous".
	DetachOnDestroyPrevious DetachOnDestroy = "previous"
	// DetachOnDestroyNext selects "next".
	DetachOnDestroyNext DetachOnDestroy = "next"
)

func (DetachOnDestroy) String

func (v DetachOnDestroy) String() string

String returns the exact tmux spelling of v.

func (DetachOnDestroy) Valid

func (v DetachOnDestroy) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type Dispatch

type Dispatch struct {
	// Ops are the indices of the operations this dispatch carries, in order.
	Ops []int
	// Marked reports that this dispatch names the object its first operation
	// creates through tmux's {marked} register, so the operations after it can
	// share the command list rather than waiting for the created ID.
	Marked bool
	// Reason says why the dispatch ends where it does. It is "chained" for a
	// command list, "creates" for an operation whose new object's ID a later
	// step needs, "captures" for one whose output the caller reads, "alone" for
	// a chainable operation with nothing beside it to chain to, and "marked"
	// for a creation carrying the operations that decorate it.
	Reason string
}

Dispatch is one tmux invocation and the operations it carries. A dispatch holding more than one operation is sent as a tmux command list.

type DisplayMenuRequest

type DisplayMenuRequest struct {
	// Items are menu rows; a zero MenuItem is a separator.
	Items []MenuItem
	// Title is the optional menu title.
	Title *string
	// TargetPane supplies pane context for format expansion.
	TargetPane PaneID
	// TargetClient selects the client that renders the menu.
	TargetClient ClientName
	// X is tmux's horizontal position expression.
	X *string
	// Y is tmux's vertical position expression.
	Y *string
	// StartingChoice selects the initial item; tmux before 3.4 refuses it; see UnsupportedPolicy.
	StartingChoice *string
	// BorderLines selects border glyphs; tmux before 3.4 refuses it; see UnsupportedPolicy.
	BorderLines *string
	// Style selects menu style; tmux before 3.4 refuses it; see UnsupportedPolicy.
	Style *string
	// BorderStyle selects border style; tmux before 3.4 refuses it; see UnsupportedPolicy.
	BorderStyle *string
	// SelectedStyle selects highlighted-item style; tmux before 3.4 refuses it; see UnsupportedPolicy.
	SelectedStyle *string
	// Mouse enables mouse selection; tmux before 3.5 refuses it; see UnsupportedPolicy.
	Mouse bool
	// StayOpen keeps the menu visible after selecting an item.
	StayOpen bool
}

DisplayMenuRequest configures one tmux popup menu. Position and style strings retain tmux's format and symbolic-position languages verbatim. Its zero value is invalid because Items is required. All pointer fields omit their flags when nil and retain explicit empty strings; DisplayMenu copies Items before calling tmux. TargetPane and TargetClient are independent but must be stable identities when present.

type DisplayMessageRequest

type DisplayMessageRequest struct {
	// Message is the optional status message; an empty message leaves tmux's default behavior.
	Message string
	// Print returns message output instead of only displaying it.
	Print bool
	// Format selects tmux output formatting.
	Format *string
	// AllFormats includes every available format value.
	AllFormats bool
	// Verbose requests verbose tmux output.
	Verbose bool
	// NoExpand disables format expansion; tmux before 3.4 refuses it; see UnsupportedPolicy.
	NoExpand bool
	// TargetClient selects the stable client receiving the display; zero omits -c.
	TargetClient ClientName
	// Delay sets display duration in milliseconds when nonnil.
	Delay *int
	// Notify triggers a notification rather than only a status message.
	Notify bool
}

DisplayMessageRequest configures display-message options shared by server, window, and pane scope. A zero request displays tmux's default message and returns nil. Print returns an owned stdout slice instead of displaying only to a client status line. Nil pointer fields omit their flags while pointers to empty values are explicit; a zero TargetClient omits its flag.

type DisplayPanesRequest

type DisplayPanesRequest struct {
	// Duration is the display time in milliseconds. Nil uses tmux's
	// display-panes-time option; zero waits for a key press. Negative values are
	// rejected before execution.
	Duration *int
	// NoSelect prevents number keys from selecting a pane, so the display
	// closes only after its duration. With Duration set to zero, it may remain
	// until the context is canceled.
	NoSelect bool
}

DisplayPanesRequest configures pane-number display for tmux's current client. This command is client-scoped and does not inherit the Pane target. Duration is read before execution and is not retained; callers must not mutate it concurrently.

type DisplayPopupRequest

type DisplayPopupRequest struct {
	// Command is interpreted by tmux as a shell command. Nil lets tmux use
	// default-command and then its default shell; nonnil empty is passed
	// explicitly and tmux resolves it directly to the default shell.
	Command *string
	// CloseOnExit closes the overlay whenever Command exits.
	CloseOnExit bool
	// CloseOnSuccess closes the overlay only when Command exits successfully.
	CloseOnSuccess bool
	// CloseExisting closes the selected client's existing overlay and prevents
	// this request from creating a replacement.
	CloseExisting bool
	// TargetClient selects the client that receives the overlay; zero lets tmux choose.
	TargetClient ClientName
	// Width is an explicit cell count or percentage and may contain tmux format
	// expressions. Nil lets tmux choose the default width.
	Width *string
	// Height is an explicit cell count or percentage and may contain tmux
	// format expressions. Nil lets tmux choose the default height.
	Height *string
	// X is a tmux popup position expression and may contain tmux formats. Nil
	// lets tmux choose the horizontal position.
	X *string
	// Y is a tmux popup position expression and may contain tmux formats. Nil
	// lets tmux choose the vertical position.
	Y *string
	// StartDirectory selects the popup working directory. Nil omits the option;
	// nonnil empty is normalized to ".". The library expands a leading local ~
	// before tmux expands formats in the resulting value.
	StartDirectory *string
	// Title is the popup title format. Nil leaves the tmux default.
	Title *string
	// BorderLines selects tmux's border-line style. NoBorder makes it
	// ineffective.
	BorderLines *string
	// Style selects the tmux style for the popup interior.
	Style *string
	// BorderStyle selects the tmux style for the popup border.
	BorderStyle *string
	// Environment adds validated popup environment entries. Nil and an empty
	// map add none; entries are sent in lexical key order.
	Environment map[string]string
	// NoBorder removes the popup border and makes BorderLines ineffective.
	NoBorder bool
	// CloseOnAnyKey lets a nonmouse, nonpaste key dismiss the popup after its
	// command has exited. It does not dismiss the popup while the job is active;
	// tmux continues to send keys to that job.
	CloseOnAnyKey bool
	// NoKeys clears automatic-close flags previously configured on an existing
	// popup. Same-request close flags are then applied, and key input remains
	// enabled.
	NoKeys bool
}

DisplayPopupRequest configures a popup overlay. Pointer and map values are read and copied before any version probe or command, and the call retains none of the caller's storage. Callers must not mutate them concurrently. Pointer fields distinguish omission from an explicit empty value, with the Command and StartDirectory behavior documented on those fields.

CloseOnExit and CloseOnSuccess are mutually exclusive. CloseExisting asks tmux only to close the existing overlay, so the remaining fields do not create a replacement. NoBorder makes BorderLines ineffective. When modifying an existing popup, NoKeys clears its configured automatic-close flags before tmux applies CloseOnExit, CloseOnSuccess, and CloseOnAnyKey from this request. NoKeys does not disable keyboard input.

type Engine

type Engine interface {
	// Supports reports whether the engine can carry requests of kind. It must
	// be deterministic and must not perform I/O: a Server consults it on every
	// command.
	Supports(kind CommandKind) bool
	// Run executes one classified request. A completed tmux command failure
	// belongs in the returned result as a nonzero ExitCode with the tmux
	// message in Stderr, matching the subprocess transport, so that operation
	// error classification is identical through either. Only a transport
	// failure is returned as an error. Returned slices are copied before they
	// reach the caller.
	Run(ctx context.Context, kind CommandKind, request CommandRequest) (CommandResult, error)
}

Engine executes tmux commands for a Server over one transport, and declares which CommandKind values that transport can carry. Selecting one with Server.WithEngine changes how commands reach tmux without changing what any operation means: a request the engine does not support runs as a tmux process instead, using the same ServerOptions.Runner it always did.

An engine does not own its own shutdown. A Server is an immutable handle that callers copy freely, so it cannot be the value that closes a transport; whoever created the transport closes it. ControlClient.Close stops the process behind ControlClient.Engine.

Run may be called concurrently when the Server is used concurrently. An engine that serializes internally, as the control-mode engine does, bounds concurrent callers to one in-flight tmux command; that is an engine property rather than an interface one, so a transport that matches replies out of order needs no change here.

type EnvironmentDecodeError

type EnvironmentDecodeError struct {
	// Record is the zero-based malformed output record number.
	Record int
	// Reason describes malformed framing without retaining the record value.
	Reason string
}

EnvironmentDecodeError reports one malformed show-environment record. It never retains the record because environment output may contain secrets.

func (*EnvironmentDecodeError) Error

func (e *EnvironmentDecodeError) Error() string

Error implements error.

func (*EnvironmentDecodeError) Unwrap

func (e *EnvironmentDecodeError) Unwrap() error

Unwrap makes EnvironmentDecodeError compatible with ErrMalformedEnvironment.

type EnvironmentNameError

type EnvironmentNameError struct {
	// Name is the invalid environment variable name.
	Name string
}

EnvironmentNameError reports a name that tmux cannot store.

func (*EnvironmentNameError) Error

func (e *EnvironmentNameError) Error() string

Error implements error.

func (*EnvironmentNameError) Unwrap

func (e *EnvironmentNameError) Unwrap() error

Unwrap makes EnvironmentNameError compatible with ErrInvalidEnvironmentName.

type EnvironmentValue

type EnvironmentValue struct {
	// Value is the exact value after tmux format expansion, if any.
	Value string
	// Removed reports that tmux will remove the variable from new processes.
	Removed bool
}

EnvironmentValue is one tmux environment value or removal marker. Its zero value is an ordinary empty value, not a removal marker.

type EnvironmentValueError

type EnvironmentValueError struct{}

EnvironmentValueError reports a value that cannot round-trip through show-environment. It intentionally does not retain or print the environment value.

func (*EnvironmentValueError) Error

func (*EnvironmentValueError) Error() string

Error implements error without disclosing the environment value.

func (*EnvironmentValueError) Unwrap

func (*EnvironmentValueError) Unwrap() error

Unwrap makes EnvironmentValueError compatible with ErrInvalidEnvironmentValue.

type ExtendedKeys

type ExtendedKeys string

ExtendedKeys is a typed value for the "extended-keys" tmux option. Its zero value is invalid.

const (
	// ExtendedKeysOff selects "off".
	ExtendedKeysOff ExtendedKeys = "off"
	// ExtendedKeysOn selects "on".
	ExtendedKeysOn ExtendedKeys = "on"
	// ExtendedKeysAlways selects "always".
	ExtendedKeysAlways ExtendedKeys = "always"
)

func (ExtendedKeys) String

func (v ExtendedKeys) String() string

String returns the exact tmux spelling of v.

func (ExtendedKeys) Valid

func (v ExtendedKeys) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type ExtendedKeysFormat

type ExtendedKeysFormat string

ExtendedKeysFormat is a typed value for the "extended-keys-format" tmux option. Its zero value is invalid.

const (
	// ExtendedKeysFormatCSIU selects "csi-u".
	ExtendedKeysFormatCSIU ExtendedKeysFormat = "csi-u"
	// ExtendedKeysFormatXTerm selects "xterm".
	ExtendedKeysFormatXTerm ExtendedKeysFormat = "xterm"
)

func (ExtendedKeysFormat) String

func (v ExtendedKeysFormat) String() string

String returns the exact tmux spelling of v.

func (ExtendedKeysFormat) Valid

func (v ExtendedKeysFormat) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type FindWindowRequest

type FindWindowRequest struct {
	// Match is the glob pattern, or regular expression when Regex is true.
	Match string
	// MatchContent restricts matching to visible window content, not history.
	MatchContent bool
	// CaseInsensitive makes matching ignore case.
	CaseInsensitive bool
	// MatchName restricts matching to window names.
	MatchName bool
	// Regex interprets Match as a regular expression instead of a glob.
	Regex bool
	// MatchTitle restricts matching to window titles.
	MatchTitle bool
}

FindWindowRequest configures the interactive window search chooser. Match is a tmux search operand, not a shell command. The zero value searches with an empty glob using tmux's default name, title, and visible-content scopes.

type Folding

type Folding struct{}

Folding groups each run of operations that neither answer nor create into one tmux command list, and sends the rest alone. It is what Plan.Run uses.

func (Folding) Plan

func (Folding) Plan(ops []Op) []Dispatch

Plan returns the dispatches for ops, grouping consecutive chainable runs.

type FormatDecodeError

type FormatDecodeError struct {
	// Record is the one-based physical record number.
	Record int
	// Field names the format field that could not be decoded.
	Field string
	// Offset is the zero-based byte offset within Field's encoded value.
	Offset int
	// Reason describes the malformed encoding.
	Reason string
}

FormatDecodeError identifies a malformed escaped tmux format record. It matches ErrMalformedFormatOutput through errors.Is; callers can recover its location fields with errors.As. Library-created errors do not retain decoded record values, which may contain caller data.

func (*FormatDecodeError) Error

func (e *FormatDecodeError) Error() string

Error implements error.

func (*FormatDecodeError) Unwrap

func (e *FormatDecodeError) Unwrap() error

Unwrap makes FormatDecodeError compatible with ErrMalformedFormatOutput.

type FormatValues

type FormatValues struct {
	// contains filtered or unexported fields
}

FormatValues is a read-only view of the tmux format expansions materialized with a Session, Window, Pane, or Client record. Its methods do not query tmux. The zero value is usable and reports every field as absent.

func (FormatValues) ActiveWindowIndex

func (v FormatValues) ActiveWindowIndex() (int, bool)

ActiveWindowIndex returns a typed int value and an ok result parsed from tmux #{active_window_index} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) AlternateOn

func (v FormatValues) AlternateOn() (bool, bool)

AlternateOn returns a typed bool value and an ok result parsed from tmux #{alternate_on} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) AlternateSavedX

func (v FormatValues) AlternateSavedX() (int, bool)

AlternateSavedX returns a typed int value and an ok result parsed from tmux #{alternate_saved_x} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) AlternateSavedY

func (v FormatValues) AlternateSavedY() (int, bool)

AlternateSavedY returns a typed int value and an ok result parsed from tmux #{alternate_saved_y} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) BracketPasteFlag

func (v FormatValues) BracketPasteFlag() (bool, bool)

BracketPasteFlag returns a typed bool value and an ok result parsed from tmux #{bracket_paste_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) BufferModeFormat

func (v FormatValues) BufferModeFormat() (string, bool)

BufferModeFormat returns a typed string value and an ok result parsed from tmux #{buffer_mode_format} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientActivity

func (v FormatValues) ClientActivity() (time.Time, bool)

ClientActivity returns a typed time.Time value and an ok result parsed from tmux #{client_activity} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientCellHeight

func (v FormatValues) ClientCellHeight() (int, bool)

ClientCellHeight returns a typed int value and an ok result parsed from tmux #{client_cell_height} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientCellWidth

func (v FormatValues) ClientCellWidth() (int, bool)

ClientCellWidth returns a typed int value and an ok result parsed from tmux #{client_cell_width} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientControlMode

func (v FormatValues) ClientControlMode() (bool, bool)

ClientControlMode returns a typed bool value and an ok result parsed from tmux #{client_control_mode} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientCreated

func (v FormatValues) ClientCreated() (time.Time, bool)

ClientCreated returns a typed time.Time value and an ok result parsed from tmux #{client_created} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientDiscarded

func (v FormatValues) ClientDiscarded() (int, bool)

ClientDiscarded returns a typed int value and an ok result parsed from tmux #{client_discarded} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientFlags

func (v FormatValues) ClientFlags() (string, bool)

ClientFlags returns a typed string value and an ok result parsed from tmux #{client_flags} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientHeight

func (v FormatValues) ClientHeight() (int, bool)

ClientHeight returns a typed int value and an ok result parsed from tmux #{client_height} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientKeyTable

func (v FormatValues) ClientKeyTable() (string, bool)

ClientKeyTable returns a typed string value and an ok result parsed from tmux #{client_key_table} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientLastSession

func (v FormatValues) ClientLastSession() (string, bool)

ClientLastSession returns a typed string value and an ok result parsed from tmux #{client_last_session} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientModeFormat

func (v FormatValues) ClientModeFormat() (string, bool)

ClientModeFormat returns a typed string value and an ok result parsed from tmux #{client_mode_format} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientName

func (v FormatValues) ClientName() (ClientName, bool)

ClientName returns a typed ClientName value and an ok result parsed from tmux #{client_name} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientPID

func (v FormatValues) ClientPID() (int, bool)

ClientPID returns a typed int value and an ok result parsed from tmux #{client_pid} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientPrefix

func (v FormatValues) ClientPrefix() (bool, bool)

ClientPrefix returns a typed bool value and an ok result parsed from tmux #{client_prefix} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientReadOnly

func (v FormatValues) ClientReadOnly() (bool, bool)

ClientReadOnly returns a typed bool value and an ok result parsed from tmux #{client_readonly} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientSession

func (v FormatValues) ClientSession() (string, bool)

ClientSession returns a typed string value and an ok result parsed from tmux #{client_session} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientTTY

func (v FormatValues) ClientTTY() (string, bool)

ClientTTY returns a typed string value and an ok result parsed from tmux #{client_tty} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientTermFeatures

func (v FormatValues) ClientTermFeatures() (string, bool)

ClientTermFeatures returns a typed string value and an ok result parsed from tmux #{client_termfeatures} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientTermName

func (v FormatValues) ClientTermName() (string, bool)

ClientTermName returns a typed string value and an ok result parsed from tmux #{client_termname} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientTermType

func (v FormatValues) ClientTermType() (string, bool)

ClientTermType returns a typed string value and an ok result parsed from tmux #{client_termtype} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientUID

func (v FormatValues) ClientUID() (int, bool)

ClientUID returns a typed int value and an ok result parsed from tmux #{client_uid} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientUTF8

func (v FormatValues) ClientUTF8() (bool, bool)

ClientUTF8 returns a typed bool value and an ok result parsed from tmux #{client_utf8} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientUser

func (v FormatValues) ClientUser() (string, bool)

ClientUser returns a typed string value and an ok result parsed from tmux #{client_user} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientWidth

func (v FormatValues) ClientWidth() (int, bool)

ClientWidth returns a typed int value and an ok result parsed from tmux #{client_width} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ClientWritten

func (v FormatValues) ClientWritten() (int, bool)

ClientWritten returns a typed int value and an ok result parsed from tmux #{client_written} in a materialized hierarchy record's client-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ConfigFiles

func (v FormatValues) ConfigFiles() (string, bool)

ConfigFiles returns a typed string value and an ok result parsed from tmux #{config_files} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorBlinking

func (v FormatValues) CursorBlinking() (bool, bool)

CursorBlinking returns a typed bool value and an ok result parsed from tmux #{cursor_blinking} in a materialized hierarchy record's pane-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorCharacter

func (v FormatValues) CursorCharacter() (string, bool)

CursorCharacter returns a typed string value and an ok result parsed from tmux #{cursor_character} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorColour

func (v FormatValues) CursorColour() (string, bool)

CursorColour returns a typed string value and an ok result parsed from tmux #{cursor_colour} in a materialized hierarchy record's pane-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorFlag

func (v FormatValues) CursorFlag() (bool, bool)

CursorFlag returns a typed bool value and an ok result parsed from tmux #{cursor_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorShape

func (v FormatValues) CursorShape() (string, bool)

CursorShape returns a typed string value and an ok result parsed from tmux #{cursor_shape} in a materialized hierarchy record's pane-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorVeryVisible

func (v FormatValues) CursorVeryVisible() (bool, bool)

CursorVeryVisible returns a typed bool value and an ok result parsed from tmux #{cursor_very_visible} in a materialized hierarchy record's pane-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorX

func (v FormatValues) CursorX() (int, bool)

CursorX returns a typed int value and an ok result parsed from tmux #{cursor_x} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) CursorY

func (v FormatValues) CursorY() (int, bool)

CursorY returns a typed int value and an ok result parsed from tmux #{cursor_y} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) HistoryAllBytes

func (v FormatValues) HistoryAllBytes() (string, bool)

HistoryAllBytes returns a typed string value and an ok result parsed from tmux #{history_all_bytes} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) HistoryBytes

func (v FormatValues) HistoryBytes() (int, bool)

HistoryBytes returns a typed int value and an ok result parsed from tmux #{history_bytes} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) HistoryLimit

func (v FormatValues) HistoryLimit() (int, bool)

HistoryLimit returns a typed int value and an ok result parsed from tmux #{history_limit} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) HistorySize

func (v FormatValues) HistorySize() (int, bool)

HistorySize returns a typed int value and an ok result parsed from tmux #{history_size} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) Host

func (v FormatValues) Host() (string, bool)

Host returns a typed string value and an ok result parsed from tmux #{host} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) HostShort

func (v FormatValues) HostShort() (string, bool)

HostShort returns a typed string value and an ok result parsed from tmux #{host_short} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) InsertFlag

func (v FormatValues) InsertFlag() (bool, bool)

InsertFlag returns a typed bool value and an ok result parsed from tmux #{insert_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) KeypadCursorFlag

func (v FormatValues) KeypadCursorFlag() (bool, bool)

KeypadCursorFlag returns a typed bool value and an ok result parsed from tmux #{keypad_cursor_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) KeypadFlag

func (v FormatValues) KeypadFlag() (bool, bool)

KeypadFlag returns a typed bool value and an ok result parsed from tmux #{keypad_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) LastWindowIndex

func (v FormatValues) LastWindowIndex() (int, bool)

LastWindowIndex returns a typed int value and an ok result parsed from tmux #{last_window_index} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) Line

func (v FormatValues) Line() (int, bool)

Line returns a typed int value and an ok result parsed from tmux #{line} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) MouseAllFlag

func (v FormatValues) MouseAllFlag() (bool, bool)

MouseAllFlag returns a typed bool value and an ok result parsed from tmux #{mouse_all_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) MouseAnyFlag

func (v FormatValues) MouseAnyFlag() (bool, bool)

MouseAnyFlag returns a typed bool value and an ok result parsed from tmux #{mouse_any_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) MouseButtonFlag

func (v FormatValues) MouseButtonFlag() (bool, bool)

MouseButtonFlag returns a typed bool value and an ok result parsed from tmux #{mouse_button_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) MouseSGRFlag

func (v FormatValues) MouseSGRFlag() (bool, bool)

MouseSGRFlag returns a typed bool value and an ok result parsed from tmux #{mouse_sgr_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) MouseStandardFlag

func (v FormatValues) MouseStandardFlag() (bool, bool)

MouseStandardFlag returns a typed bool value and an ok result parsed from tmux #{mouse_standard_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) MouseUTF8Flag

func (v FormatValues) MouseUTF8Flag() (bool, bool)

MouseUTF8Flag returns a typed bool value and an ok result parsed from tmux #{mouse_utf8_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) NextSessionID

func (v FormatValues) NextSessionID() (SessionID, bool)

NextSessionID returns a typed SessionID value and an ok result parsed from tmux #{next_session_id} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) OriginFlag

func (v FormatValues) OriginFlag() (bool, bool)

OriginFlag returns a typed bool value and an ok result parsed from tmux #{origin_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PID

func (v FormatValues) PID() (int, bool)

PID returns a typed int value and an ok result parsed from tmux #{pid} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneActive

func (v FormatValues) PaneActive() (bool, bool)

PaneActive returns a typed bool value and an ok result parsed from tmux #{pane_active} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneAtBottom

func (v FormatValues) PaneAtBottom() (bool, bool)

PaneAtBottom returns a typed bool value and an ok result parsed from tmux #{pane_at_bottom} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneAtLeft

func (v FormatValues) PaneAtLeft() (bool, bool)

PaneAtLeft returns a typed bool value and an ok result parsed from tmux #{pane_at_left} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneAtRight

func (v FormatValues) PaneAtRight() (bool, bool)

PaneAtRight returns a typed bool value and an ok result parsed from tmux #{pane_at_right} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneAtTop

func (v FormatValues) PaneAtTop() (bool, bool)

PaneAtTop returns a typed bool value and an ok result parsed from tmux #{pane_at_top} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneBG

func (v FormatValues) PaneBG() (string, bool)

PaneBG returns a typed string value and an ok result parsed from tmux #{pane_bg} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneBottom

func (v FormatValues) PaneBottom() (int, bool)

PaneBottom returns a typed int value and an ok result parsed from tmux #{pane_bottom} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneCurrentCommand

func (v FormatValues) PaneCurrentCommand() (string, bool)

PaneCurrentCommand returns a typed string value and an ok result parsed from tmux #{pane_current_command} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneCurrentPath

func (v FormatValues) PaneCurrentPath() (string, bool)

PaneCurrentPath returns a typed string value and an ok result parsed from tmux #{pane_current_path} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneDead

func (v FormatValues) PaneDead() (bool, bool)

PaneDead returns a typed bool value and an ok result parsed from tmux #{pane_dead} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneDeadSignal

func (v FormatValues) PaneDeadSignal() (string, bool)

PaneDeadSignal returns a typed string value and an ok result parsed from tmux #{pane_dead_signal} in a materialized hierarchy record's pane-scoped fields (tmux 3.3 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneDeadStatus

func (v FormatValues) PaneDeadStatus() (int, bool)

PaneDeadStatus returns a typed int value and an ok result parsed from tmux #{pane_dead_status} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneDeadTime

func (v FormatValues) PaneDeadTime() (time.Time, bool)

PaneDeadTime returns a typed time.Time value and an ok result parsed from tmux #{pane_dead_time} in a materialized hierarchy record's pane-scoped fields (tmux 3.3 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneFG

func (v FormatValues) PaneFG() (string, bool)

PaneFG returns a typed string value and an ok result parsed from tmux #{pane_fg} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneFlags

func (v FormatValues) PaneFlags() (string, bool)

PaneFlags returns a typed string value and an ok result parsed from tmux #{pane_flags} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneFloatingFlag

func (v FormatValues) PaneFloatingFlag() (bool, bool)

PaneFloatingFlag returns a typed bool value and an ok result parsed from tmux #{pane_floating_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneFormat

func (v FormatValues) PaneFormat() (bool, bool)

PaneFormat returns a typed bool value and an ok result parsed from tmux #{pane_format} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneHeight

func (v FormatValues) PaneHeight() (int, bool)

PaneHeight returns a typed int value and an ok result parsed from tmux #{pane_height} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneID

func (v FormatValues) PaneID() (PaneID, bool)

PaneID returns a typed PaneID value and an ok result parsed from tmux #{pane_id} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneInMode

func (v FormatValues) PaneInMode() (int, bool)

PaneInMode returns a typed int value and an ok result parsed from tmux #{pane_in_mode} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneIndex

func (v FormatValues) PaneIndex() (int, bool)

PaneIndex returns a typed int value and an ok result parsed from tmux #{pane_index} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneInputOff

func (v FormatValues) PaneInputOff() (bool, bool)

PaneInputOff returns a typed bool value and an ok result parsed from tmux #{pane_input_off} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneKeyMode

func (v FormatValues) PaneKeyMode() (string, bool)

PaneKeyMode returns a typed string value and an ok result parsed from tmux #{pane_key_mode} in a materialized hierarchy record's pane-scoped fields (tmux 3.5 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneLast

func (v FormatValues) PaneLast() (bool, bool)

PaneLast returns a typed bool value and an ok result parsed from tmux #{pane_last} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneLeft

func (v FormatValues) PaneLeft() (int, bool)

PaneLeft returns a typed int value and an ok result parsed from tmux #{pane_left} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneMarked

func (v FormatValues) PaneMarked() (bool, bool)

PaneMarked returns a typed bool value and an ok result parsed from tmux #{pane_marked} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneMarkedSet

func (v FormatValues) PaneMarkedSet() (bool, bool)

PaneMarkedSet returns a typed bool value and an ok result parsed from tmux #{pane_marked_set} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneMode

func (v FormatValues) PaneMode() (string, bool)

PaneMode returns a typed string value and an ok result parsed from tmux #{pane_mode} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PanePBProgress

func (v FormatValues) PanePBProgress() (int, bool)

PanePBProgress returns a typed int value and an ok result parsed from tmux #{pane_pb_progress} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PanePBState

func (v FormatValues) PanePBState() (string, bool)

PanePBState returns a typed string value and an ok result parsed from tmux #{pane_pb_state} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PanePID

func (v FormatValues) PanePID() (int, bool)

PanePID returns a typed int value and an ok result parsed from tmux #{pane_pid} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PanePath

func (v FormatValues) PanePath() (string, bool)

PanePath returns a typed string value and an ok result parsed from tmux #{pane_path} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PanePipe

func (v FormatValues) PanePipe() (bool, bool)

PanePipe returns a typed bool value and an ok result parsed from tmux #{pane_pipe} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PanePipePID

func (v FormatValues) PanePipePID() (int, bool)

PanePipePID returns a typed int value and an ok result parsed from tmux #{pane_pipe_pid} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneRight

func (v FormatValues) PaneRight() (int, bool)

PaneRight returns a typed int value and an ok result parsed from tmux #{pane_right} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneSearchString

func (v FormatValues) PaneSearchString() (string, bool)

PaneSearchString returns a typed string value and an ok result parsed from tmux #{pane_search_string} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneStartCommand

func (v FormatValues) PaneStartCommand() (string, bool)

PaneStartCommand returns a typed string value and an ok result parsed from tmux #{pane_start_command} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneStartPath

func (v FormatValues) PaneStartPath() (string, bool)

PaneStartPath returns a typed string value and an ok result parsed from tmux #{pane_start_path} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneSynchronized

func (v FormatValues) PaneSynchronized() (bool, bool)

PaneSynchronized returns a typed bool value and an ok result parsed from tmux #{pane_synchronized} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneTTY

func (v FormatValues) PaneTTY() (string, bool)

PaneTTY returns a typed string value and an ok result parsed from tmux #{pane_tty} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneTabs

func (v FormatValues) PaneTabs() (string, bool)

PaneTabs returns a typed string value and an ok result parsed from tmux #{pane_tabs} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneTitle

func (v FormatValues) PaneTitle() (string, bool)

PaneTitle returns a typed string value and an ok result parsed from tmux #{pane_title} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneTop

func (v FormatValues) PaneTop() (int, bool)

PaneTop returns a typed int value and an ok result parsed from tmux #{pane_top} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneUnseenChanges

func (v FormatValues) PaneUnseenChanges() (bool, bool)

PaneUnseenChanges returns a typed bool value and an ok result parsed from tmux #{pane_unseen_changes} in a materialized hierarchy record's pane-scoped fields (tmux 3.4 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneWidth

func (v FormatValues) PaneWidth() (int, bool)

PaneWidth returns a typed int value and an ok result parsed from tmux #{pane_width} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneX

func (v FormatValues) PaneX() (int, bool)

PaneX returns a typed int value and an ok result parsed from tmux #{pane_x} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneY

func (v FormatValues) PaneY() (int, bool)

PaneY returns a typed int value and an ok result parsed from tmux #{pane_y} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneZ

func (v FormatValues) PaneZ() (int, bool)

PaneZ returns a typed int value and an ok result parsed from tmux #{pane_z} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) PaneZoomedFlag

func (v FormatValues) PaneZoomedFlag() (bool, bool)

PaneZoomedFlag returns a typed bool value and an ok result parsed from tmux #{pane_zoomed_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) Raw

func (v FormatValues) Raw(name string) (string, bool)

Raw returns the exact materialized tmux format expansion for name. It never queries tmux; ok distinguishes an absent field from a present empty value.

func (FormatValues) ScrollRegionLower

func (v FormatValues) ScrollRegionLower() (int, bool)

ScrollRegionLower returns a typed int value and an ok result parsed from tmux #{scroll_region_lower} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ScrollRegionUpper

func (v FormatValues) ScrollRegionUpper() (int, bool)

ScrollRegionUpper returns a typed int value and an ok result parsed from tmux #{scroll_region_upper} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) ServerSessions

func (v FormatValues) ServerSessions() (int, bool)

ServerSessions returns a typed int value and an ok result parsed from tmux #{server_sessions} in a materialized hierarchy record's universal-scoped fields (tmux 3.4 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionActive

func (v FormatValues) SessionActive() (bool, bool)

SessionActive returns a typed bool value and an ok result parsed from tmux #{session_active} in a materialized hierarchy record's session-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionActivity

func (v FormatValues) SessionActivity() (time.Time, bool)

SessionActivity returns a typed time.Time value and an ok result parsed from tmux #{session_activity} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionActivityFlag

func (v FormatValues) SessionActivityFlag() (bool, bool)

SessionActivityFlag returns a typed bool value and an ok result parsed from tmux #{session_activity_flag} in a materialized hierarchy record's session-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionAlert

func (v FormatValues) SessionAlert() (string, bool)

SessionAlert returns a typed string value and an ok result parsed from tmux #{session_alert} in a materialized hierarchy record's session-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionAlerts

func (v FormatValues) SessionAlerts() (string, bool)

SessionAlerts returns a typed string value and an ok result parsed from tmux #{session_alerts} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionAttached

func (v FormatValues) SessionAttached() (int, bool)

SessionAttached returns a typed int value and an ok result parsed from tmux #{session_attached} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionAttachedList

func (v FormatValues) SessionAttachedList() (string, bool)

SessionAttachedList returns a typed string value and an ok result parsed from tmux #{session_attached_list} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionBellFlag

func (v FormatValues) SessionBellFlag() (bool, bool)

SessionBellFlag returns a typed bool value and an ok result parsed from tmux #{session_bell_flag} in a materialized hierarchy record's session-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionCreated

func (v FormatValues) SessionCreated() (time.Time, bool)

SessionCreated returns a typed time.Time value and an ok result parsed from tmux #{session_created} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionFormat

func (v FormatValues) SessionFormat() (bool, bool)

SessionFormat returns a typed bool value and an ok result parsed from tmux #{session_format} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGroup

func (v FormatValues) SessionGroup() (string, bool)

SessionGroup returns a typed string value and an ok result parsed from tmux #{session_group} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGroupAttached

func (v FormatValues) SessionGroupAttached() (int, bool)

SessionGroupAttached returns a typed int value and an ok result parsed from tmux #{session_group_attached} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGroupAttachedList

func (v FormatValues) SessionGroupAttachedList() (string, bool)

SessionGroupAttachedList returns a typed string value and an ok result parsed from tmux #{session_group_attached_list} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGroupList

func (v FormatValues) SessionGroupList() (string, bool)

SessionGroupList returns a typed string value and an ok result parsed from tmux #{session_group_list} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGroupManyAttached

func (v FormatValues) SessionGroupManyAttached() (bool, bool)

SessionGroupManyAttached returns a typed bool value and an ok result parsed from tmux #{session_group_many_attached} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGroupSize

func (v FormatValues) SessionGroupSize() (int, bool)

SessionGroupSize returns a typed int value and an ok result parsed from tmux #{session_group_size} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionGrouped

func (v FormatValues) SessionGrouped() (bool, bool)

SessionGrouped returns a typed bool value and an ok result parsed from tmux #{session_grouped} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionID

func (v FormatValues) SessionID() (SessionID, bool)

SessionID returns a typed SessionID value and an ok result parsed from tmux #{session_id} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionLastAttached

func (v FormatValues) SessionLastAttached() (time.Time, bool)

SessionLastAttached returns a typed time.Time value and an ok result parsed from tmux #{session_last_attached} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionManyAttached

func (v FormatValues) SessionManyAttached() (bool, bool)

SessionManyAttached returns a typed bool value and an ok result parsed from tmux #{session_many_attached} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionMarked

func (v FormatValues) SessionMarked() (bool, bool)

SessionMarked returns a typed bool value and an ok result parsed from tmux #{session_marked} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionName

func (v FormatValues) SessionName() (string, bool)

SessionName returns a typed string value and an ok result parsed from tmux #{session_name} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionPath

func (v FormatValues) SessionPath() (string, bool)

SessionPath returns a typed string value and an ok result parsed from tmux #{session_path} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionSilenceFlag

func (v FormatValues) SessionSilenceFlag() (bool, bool)

SessionSilenceFlag returns a typed bool value and an ok result parsed from tmux #{session_silence_flag} in a materialized hierarchy record's session-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionStack

func (v FormatValues) SessionStack() (string, bool)

SessionStack returns a typed string value and an ok result parsed from tmux #{session_stack} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SessionWindows

func (v FormatValues) SessionWindows() (int, bool)

SessionWindows returns a typed int value and an ok result parsed from tmux #{session_windows} in a materialized hierarchy record's session-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SixelSupport

func (v FormatValues) SixelSupport() (bool, bool)

SixelSupport returns a typed bool value and an ok result parsed from tmux #{sixel_support} in a materialized hierarchy record's universal-scoped fields (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SocketPath

func (v FormatValues) SocketPath() (string, bool)

SocketPath returns a typed string value and an ok result parsed from tmux #{socket_path} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) StartTime

func (v FormatValues) StartTime() (time.Time, bool)

StartTime returns a typed time.Time value and an ok result parsed from tmux #{start_time} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) SynchronizedOutputFlag

func (v FormatValues) SynchronizedOutputFlag() (bool, bool)

SynchronizedOutputFlag returns a typed bool value and an ok result parsed from tmux #{synchronized_output_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) TreeModeFormat

func (v FormatValues) TreeModeFormat() (string, bool)

TreeModeFormat returns a typed string value and an ok result parsed from tmux #{tree_mode_format} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) UID

func (v FormatValues) UID() (int, bool)

UID returns a typed int value and an ok result parsed from tmux #{uid} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) User

func (v FormatValues) User() (string, bool)

User returns a typed string value and an ok result parsed from tmux #{user} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) Version

func (v FormatValues) Version() (Version, bool)

Version returns a typed Version value and an ok result parsed from tmux #{version} in a materialized hierarchy record's universal-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActive

func (v FormatValues) WindowActive() (bool, bool)

WindowActive returns a typed bool value and an ok result parsed from tmux #{window_active} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActiveClients

func (v FormatValues) WindowActiveClients() (int, bool)

WindowActiveClients returns a typed int value and an ok result parsed from tmux #{window_active_clients} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActiveClientsList

func (v FormatValues) WindowActiveClientsList() (string, bool)

WindowActiveClientsList returns a typed string value and an ok result parsed from tmux #{window_active_clients_list} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActiveSessions

func (v FormatValues) WindowActiveSessions() (int, bool)

WindowActiveSessions returns a typed int value and an ok result parsed from tmux #{window_active_sessions} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActiveSessionsList

func (v FormatValues) WindowActiveSessionsList() (string, bool)

WindowActiveSessionsList returns a typed string value and an ok result parsed from tmux #{window_active_sessions_list} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActivity

func (v FormatValues) WindowActivity() (time.Time, bool)

WindowActivity returns a typed time.Time value and an ok result parsed from tmux #{window_activity} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowActivityFlag

func (v FormatValues) WindowActivityFlag() (bool, bool)

WindowActivityFlag returns a typed bool value and an ok result parsed from tmux #{window_activity_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowBellFlag

func (v FormatValues) WindowBellFlag() (bool, bool)

WindowBellFlag returns a typed bool value and an ok result parsed from tmux #{window_bell_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowBigger

func (v FormatValues) WindowBigger() (bool, bool)

WindowBigger returns a typed bool value and an ok result parsed from tmux #{window_bigger} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowCellHeight

func (v FormatValues) WindowCellHeight() (int, bool)

WindowCellHeight returns a typed int value and an ok result parsed from tmux #{window_cell_height} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowCellWidth

func (v FormatValues) WindowCellWidth() (int, bool)

WindowCellWidth returns a typed int value and an ok result parsed from tmux #{window_cell_width} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowEndFlag

func (v FormatValues) WindowEndFlag() (bool, bool)

WindowEndFlag returns a typed bool value and an ok result parsed from tmux #{window_end_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowFlags

func (v FormatValues) WindowFlags() (string, bool)

WindowFlags returns a typed string value and an ok result parsed from tmux #{window_flags} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowFormat

func (v FormatValues) WindowFormat() (bool, bool)

WindowFormat returns a typed bool value and an ok result parsed from tmux #{window_format} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowHeight

func (v FormatValues) WindowHeight() (int, bool)

WindowHeight returns a typed int value and an ok result parsed from tmux #{window_height} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowID

func (v FormatValues) WindowID() (WindowID, bool)

WindowID returns a typed WindowID value and an ok result parsed from tmux #{window_id} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowIndex

func (v FormatValues) WindowIndex() (int, bool)

WindowIndex returns a typed int value and an ok result parsed from tmux #{window_index} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowLastFlag

func (v FormatValues) WindowLastFlag() (bool, bool)

WindowLastFlag returns a typed bool value and an ok result parsed from tmux #{window_last_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowLayout

func (v FormatValues) WindowLayout() (string, bool)

WindowLayout returns a typed string value and an ok result parsed from tmux #{window_layout} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowLinked

func (v FormatValues) WindowLinked() (bool, bool)

WindowLinked returns a typed bool value and an ok result parsed from tmux #{window_linked} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowLinkedSessions

func (v FormatValues) WindowLinkedSessions() (int, bool)

WindowLinkedSessions returns a typed int value and an ok result parsed from tmux #{window_linked_sessions} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowLinkedSessionsList

func (v FormatValues) WindowLinkedSessionsList() (string, bool)

WindowLinkedSessionsList returns a typed string value and an ok result parsed from tmux #{window_linked_sessions_list} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowMarkedFlag

func (v FormatValues) WindowMarkedFlag() (bool, bool)

WindowMarkedFlag returns a typed bool value and an ok result parsed from tmux #{window_marked_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowName

func (v FormatValues) WindowName() (string, bool)

WindowName returns a typed string value and an ok result parsed from tmux #{window_name} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowOffsetX

func (v FormatValues) WindowOffsetX() (int, bool)

WindowOffsetX returns a typed int value and an ok result parsed from tmux #{window_offset_x} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowOffsetY

func (v FormatValues) WindowOffsetY() (int, bool)

WindowOffsetY returns a typed int value and an ok result parsed from tmux #{window_offset_y} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowPanes

func (v FormatValues) WindowPanes() (int, bool)

WindowPanes returns a typed int value and an ok result parsed from tmux #{window_panes} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowRawFlags

func (v FormatValues) WindowRawFlags() (string, bool)

WindowRawFlags returns a typed string value and an ok result parsed from tmux #{window_raw_flags} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowSilenceFlag

func (v FormatValues) WindowSilenceFlag() (bool, bool)

WindowSilenceFlag returns a typed bool value and an ok result parsed from tmux #{window_silence_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowStackIndex

func (v FormatValues) WindowStackIndex() (int, bool)

WindowStackIndex returns a typed int value and an ok result parsed from tmux #{window_stack_index} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowStartFlag

func (v FormatValues) WindowStartFlag() (bool, bool)

WindowStartFlag returns a typed bool value and an ok result parsed from tmux #{window_start_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowVisibleLayout

func (v FormatValues) WindowVisibleLayout() (string, bool)

WindowVisibleLayout returns a typed string value and an ok result parsed from tmux #{window_visible_layout} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowWidth

func (v FormatValues) WindowWidth() (int, bool)

WindowWidth returns a typed int value and an ok result parsed from tmux #{window_width} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WindowZoomedFlag

func (v FormatValues) WindowZoomedFlag() (bool, bool)

WindowZoomedFlag returns a typed bool value and an ok result parsed from tmux #{window_zoomed_flag} in a materialized hierarchy record's window-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (FormatValues) WrapFlag

func (v FormatValues) WrapFlag() (bool, bool)

WrapFlag returns a typed bool value and an ok result parsed from tmux #{wrap_flag} in a materialized hierarchy record's pane-scoped fields (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy; projected cross-scope fields do not guarantee that the referenced object is present in the same snapshot. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

type FromEnvError

type FromEnvError struct {
	// Variable is the discovery variable name, never its value.
	Variable string
	// Reason describes why the variable cannot identify a tmux resource.
	Reason string
}

FromEnvError reports which tmux discovery variable was missing or malformed. It never retains or prints the variable's value.

func (*FromEnvError) Error

func (e *FromEnvError) Error() string

Error implements error.

func (*FromEnvError) Unwrap

func (e *FromEnvError) Unwrap() error

Unwrap makes FromEnvError compatible with ErrNotInsideTmux.

type GetClipboard

type GetClipboard string

GetClipboard is a typed value for the "get-clipboard" tmux option. Its zero value is invalid.

const (
	// GetClipboardOff selects "off".
	GetClipboardOff GetClipboard = "off"
	// GetClipboardBuffer selects "buffer".
	GetClipboardBuffer GetClipboard = "buffer"
	// GetClipboardRequest selects "request".
	GetClipboardRequest GetClipboard = "request"
	// GetClipboardBoth selects "both".
	GetClipboardBoth GetClipboard = "both"
)

func (GetClipboard) String

func (v GetClipboard) String() string

String returns the exact tmux spelling of v.

func (GetClipboard) Valid

func (v GetClipboard) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type GlobalSessionScope

type GlobalSessionScope struct {
	// contains filtered or unexported fields
}

GlobalSessionScope is an immutable handle for global session options and hooks. Its zero value uses the zero Server and tmux's default connection.

func (GlobalSessionScope) AppendHook

func (s GlobalSessionScope) AppendHook(ctx context.Context, name string, command string) error

AppendHook appends a global session-scope hook without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the append.

func (GlobalSessionScope) AppendOption

func (s GlobalSessionScope) AppendOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

AppendOption appends to a global session option without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.

func (GlobalSessionScope) Hooks

Hooks returns a freshly decoded, caller-owned view of known global session-scope hooks, including inherited values. A read failure is returned rather than answered with zero values.

func (GlobalSessionScope) Options

Options returns a freshly decoded, caller-owned view of known global session options, including defaults. A read failure is returned rather than answered with zero values; context errors propagate. Each returned accessor names the setter that writes it, so SessionOptionValues.Status pairs with GlobalSessionScope.SetStatus.

func (GlobalSessionScope) RawHook

func (s GlobalSessionScope) RawHook(ctx context.Context, name string) (string, bool, error)

RawHook returns one exact global session-scope hook value. A successful string is caller-owned; ok reports presence. Targeted reads do not use list leniency, and completed failures return a secret-safe option error. An unindexed empty hook array is ambiguous; use Hooks for typed presence.

func (GlobalSessionScope) RawOption

func (s GlobalSessionScope) RawOption(
	ctx context.Context,
	name string,
) (string, bool, error)

RawOption returns one exact global session-option value. A successful string is caller-owned, and ok reports presence. An unindexed empty array is indistinguishable from an empty scalar; use Options for typed array presence.

func (GlobalSessionScope) RunHook

func (s GlobalSessionScope) RunHook(ctx context.Context, name string) error

RunHook asks tmux to run one global hook directly. It intentionally performs no racy target preflight; stale targets and global execution context remain tmux-defined. Completed failures are secret-safe option errors; cancellation does not prove hook delivery or execution did not occur.

func (GlobalSessionScope) SetActivityAction

func (s GlobalSessionScope) SetActivityAction(ctx context.Context, value ActivityAction) error

SetActivityAction stores the "activity-action" session option, available since tmux 3.2a. It accepts ActivityAction and does not expose raw set-option flags. Read it back with SessionOptionValues.ActivityAction from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetAssumePasteTime

func (s GlobalSessionScope) SetAssumePasteTime(ctx context.Context, value int64) error

SetAssumePasteTime stores the "assume-paste-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.AssumePasteTime from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetBaseIndex

func (s GlobalSessionScope) SetBaseIndex(ctx context.Context, value int64) error

SetBaseIndex stores the "base-index" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.BaseIndex from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetBellAction

func (s GlobalSessionScope) SetBellAction(ctx context.Context, value BellAction) error

SetBellAction stores the "bell-action" session option, available since tmux 3.2a. It accepts BellAction and does not expose raw set-option flags. Read it back with SessionOptionValues.BellAction from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDefaultCommand

func (s GlobalSessionScope) SetDefaultCommand(ctx context.Context, value string) error

SetDefaultCommand stores the "default-command" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DefaultCommand from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDefaultShell

func (s GlobalSessionScope) SetDefaultShell(ctx context.Context, value string) error

SetDefaultShell stores the "default-shell" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DefaultShell from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDefaultSize

func (s GlobalSessionScope) SetDefaultSize(ctx context.Context, value string) error

SetDefaultSize stores the "default-size" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DefaultSize from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDestroyUnattached

func (s GlobalSessionScope) SetDestroyUnattached(ctx context.Context, value DestroyUnattached) error

SetDestroyUnattached stores the "destroy-unattached" session option, available since tmux 3.2a. It accepts DestroyUnattached and does not expose raw set-option flags. Read it back with SessionOptionValues.DestroyUnattached from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDetachOnDestroy

func (s GlobalSessionScope) SetDetachOnDestroy(ctx context.Context, value DetachOnDestroy) error

SetDetachOnDestroy stores the "detach-on-destroy" session option, available since tmux 3.2a. It accepts DetachOnDestroy and does not expose raw set-option flags. Read it back with SessionOptionValues.DetachOnDestroy from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDisplayPanesActiveColour

func (s GlobalSessionScope) SetDisplayPanesActiveColour(ctx context.Context, value string) error

SetDisplayPanesActiveColour stores the "display-panes-active-colour" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayPanesActiveColour from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDisplayPanesColour

func (s GlobalSessionScope) SetDisplayPanesColour(ctx context.Context, value string) error

SetDisplayPanesColour stores the "display-panes-colour" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayPanesColour from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDisplayPanesTime

func (s GlobalSessionScope) SetDisplayPanesTime(ctx context.Context, value int64) error

SetDisplayPanesTime stores the "display-panes-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayPanesTime from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetDisplayTime

func (s GlobalSessionScope) SetDisplayTime(ctx context.Context, value int64) error

SetDisplayTime stores the "display-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayTime from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetFocusFollowsMouse

func (s GlobalSessionScope) SetFocusFollowsMouse(ctx context.Context, value bool) error

SetFocusFollowsMouse stores the "focus-follows-mouse" session option, available since tmux 3.7. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.FocusFollowsMouse from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetHistoryLimit

func (s GlobalSessionScope) SetHistoryLimit(ctx context.Context, value int64) error

SetHistoryLimit stores the "history-limit" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.HistoryLimit from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetHook

func (s GlobalSessionScope) SetHook(ctx context.Context, name string, command string) error

SetHook stores a global session-scope hook without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-global-hook",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// The global scope sets a hook for every session, including ones created
	// after it, rather than for one session that already exists.
	global := server.GlobalSessionScope()
	if err := global.SetHook(ctx, "client-attached", "display-message 'client attached'"); err != nil {
		fmt.Println("set hook:", err)
		return
	}
	hooks, err := global.Hooks(ctx)
	if err != nil {
		fmt.Println("read hooks:", err)
		return
	}
	// A hook holds an array of commands rather than one, so the value is
	// sparse: tmux numbers the entries and any index may be absent.
	commands, present := hooks.ClientAttached().Get()
	if !present {
		fmt.Println("no client-attached hook")
		return
	}
	command, _ := commands.Get(0)
	fmt.Println(commands.Indices(), command)
}
Output:
[0] display-message "client attached"

func (GlobalSessionScope) SetHooks

func (s GlobalSessionScope) SetHooks(
	ctx context.Context,
	name string,
	values SparseArray[string],
	options SetHooksOptions,
) (SetHooksResult, error)

SetHooks applies indexed global session-scope hook commands in ascending order. With ClearExisting it confirms clearing before applying sparse Values. It stops at the first failure without rollback; the returned result reports only confirmed partial progress and owns AppliedIndices. Cancellation may follow accepted commands and cannot disprove their delivery.

func (GlobalSessionScope) SetInitialRepeatTime

func (s GlobalSessionScope) SetInitialRepeatTime(ctx context.Context, value int64) error

SetInitialRepeatTime stores the "initial-repeat-time" session option, available since tmux 3.6. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.InitialRepeatTime from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetKeyTable

func (s GlobalSessionScope) SetKeyTable(ctx context.Context, value string) error

SetKeyTable stores the "key-table" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.KeyTable from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetLockAfterTime

func (s GlobalSessionScope) SetLockAfterTime(ctx context.Context, value int64) error

SetLockAfterTime stores the "lock-after-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.LockAfterTime from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetLockCommand

func (s GlobalSessionScope) SetLockCommand(ctx context.Context, value string) error

SetLockCommand stores the "lock-command" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.LockCommand from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetMessageCommandStyle

func (s GlobalSessionScope) SetMessageCommandStyle(ctx context.Context, value string) error

SetMessageCommandStyle stores the "message-command-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageCommandStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetMessageFormat

func (s GlobalSessionScope) SetMessageFormat(ctx context.Context, value string) error

SetMessageFormat stores the "message-format" session option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageFormat from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetMessageLine

func (s GlobalSessionScope) SetMessageLine(ctx context.Context, value MessageLine) error

SetMessageLine stores the "message-line" session option, available since tmux 3.4. It accepts MessageLine and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageLine from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetMessageStyle

func (s GlobalSessionScope) SetMessageStyle(ctx context.Context, value string) error

SetMessageStyle stores the "message-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetMouse

func (s GlobalSessionScope) SetMouse(ctx context.Context, value bool) error

SetMouse stores the "mouse" session option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.Mouse from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetOption

func (s GlobalSessionScope) SetOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

SetOption stores a global session option without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (GlobalSessionScope) SetPrefix

func (s GlobalSessionScope) SetPrefix(ctx context.Context, value string) error

SetPrefix stores the "prefix" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.Prefix from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetPrefix2

func (s GlobalSessionScope) SetPrefix2(ctx context.Context, value string) error

SetPrefix2 stores the "prefix2" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.Prefix2 from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetPromptCommandCursorStyle

func (s GlobalSessionScope) SetPromptCommandCursorStyle(ctx context.Context, value PromptCommandCursorStyle) error

SetPromptCommandCursorStyle stores the "prompt-command-cursor-style" session option, available since tmux 3.7. It accepts PromptCommandCursorStyle and does not expose raw set-option flags. Read it back with SessionOptionValues.PromptCommandCursorStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetPromptCursorColour

func (s GlobalSessionScope) SetPromptCursorColour(ctx context.Context, value string) error

SetPromptCursorColour stores the "prompt-cursor-colour" session option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.PromptCursorColour from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetPromptCursorStyle

func (s GlobalSessionScope) SetPromptCursorStyle(ctx context.Context, value PromptCursorStyle) error

SetPromptCursorStyle stores the "prompt-cursor-style" session option, available since tmux 3.6. It accepts PromptCursorStyle and does not expose raw set-option flags. Read it back with SessionOptionValues.PromptCursorStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetRenumberWindows

func (s GlobalSessionScope) SetRenumberWindows(ctx context.Context, value bool) error

SetRenumberWindows stores the "renumber-windows" session option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.RenumberWindows from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetRepeatTime

func (s GlobalSessionScope) SetRepeatTime(ctx context.Context, value int64) error

SetRepeatTime stores the "repeat-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.RepeatTime from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetSilenceAction

func (s GlobalSessionScope) SetSilenceAction(ctx context.Context, value SilenceAction) error

SetSilenceAction stores the "silence-action" session option, available since tmux 3.2a. It accepts SilenceAction and does not expose raw set-option flags. Read it back with SessionOptionValues.SilenceAction from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatus

func (s GlobalSessionScope) SetStatus(ctx context.Context, value Status) error

SetStatus stores the "status" session option, available since tmux 3.2a. It accepts Status and does not expose raw set-option flags. Read it back with SessionOptionValues.Status from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusBG

func (s GlobalSessionScope) SetStatusBG(ctx context.Context, value string) error

SetStatusBG stores the "status-bg" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusBG from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusFG

func (s GlobalSessionScope) SetStatusFG(ctx context.Context, value string) error

SetStatusFG stores the "status-fg" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusFG from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusFormat

func (s GlobalSessionScope) SetStatusFormat(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetStatusFormat performs a complete replacement of the "status-format" session option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusFormat from GlobalSessionScope.Options. Use GlobalSessionScope.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use GlobalSessionScope.UnsetOption to restore inheritance or the global default.

func (GlobalSessionScope) SetStatusInterval

func (s GlobalSessionScope) SetStatusInterval(ctx context.Context, value int64) error

SetStatusInterval stores the "status-interval" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusInterval from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusJustify

func (s GlobalSessionScope) SetStatusJustify(ctx context.Context, value StatusJustify) error

SetStatusJustify stores the "status-justify" session option, available since tmux 3.2a. It accepts StatusJustify and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusJustify from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusKeys

func (s GlobalSessionScope) SetStatusKeys(ctx context.Context, value StatusKeys) error

SetStatusKeys stores the "status-keys" session option, available since tmux 3.2a. It accepts StatusKeys and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusKeys from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusLeft

func (s GlobalSessionScope) SetStatusLeft(ctx context.Context, value string) error

SetStatusLeft stores the "status-left" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusLeft from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusLeftLength

func (s GlobalSessionScope) SetStatusLeftLength(ctx context.Context, value int64) error

SetStatusLeftLength stores the "status-left-length" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusLeftLength from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusLeftStyle

func (s GlobalSessionScope) SetStatusLeftStyle(ctx context.Context, value string) error

SetStatusLeftStyle stores the "status-left-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusLeftStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusPosition

func (s GlobalSessionScope) SetStatusPosition(ctx context.Context, value StatusPosition) error

SetStatusPosition stores the "status-position" session option, available since tmux 3.2a. It accepts StatusPosition and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusPosition from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusRight

func (s GlobalSessionScope) SetStatusRight(ctx context.Context, value string) error

SetStatusRight stores the "status-right" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusRight from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusRightLength

func (s GlobalSessionScope) SetStatusRightLength(ctx context.Context, value int64) error

SetStatusRightLength stores the "status-right-length" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusRightLength from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusRightStyle

func (s GlobalSessionScope) SetStatusRightStyle(ctx context.Context, value string) error

SetStatusRightStyle stores the "status-right-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusRightStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetStatusStyle

func (s GlobalSessionScope) SetStatusStyle(ctx context.Context, value string) error

SetStatusStyle stores the "status-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusStyle from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetTitles

func (s GlobalSessionScope) SetTitles(ctx context.Context, value bool) error

SetTitles stores the "set-titles" session option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.SetTitles from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetTitlesString

func (s GlobalSessionScope) SetTitlesString(ctx context.Context, value string) error

SetTitlesString stores the "set-titles-string" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.SetTitlesString from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetUpdateEnvironment

func (s GlobalSessionScope) SetUpdateEnvironment(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetUpdateEnvironment performs a complete replacement of the "update-environment" session option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with SessionOptionValues.UpdateEnvironment from GlobalSessionScope.Options. Use GlobalSessionScope.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use GlobalSessionScope.UnsetOption to restore inheritance or the global default.

func (GlobalSessionScope) SetVisualActivity

func (s GlobalSessionScope) SetVisualActivity(ctx context.Context, value VisualActivity) error

SetVisualActivity stores the "visual-activity" session option, available since tmux 3.2a. It accepts VisualActivity and does not expose raw set-option flags. Read it back with SessionOptionValues.VisualActivity from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetVisualBell

func (s GlobalSessionScope) SetVisualBell(ctx context.Context, value VisualBell) error

SetVisualBell stores the "visual-bell" session option, available since tmux 3.2a. It accepts VisualBell and does not expose raw set-option flags. Read it back with SessionOptionValues.VisualBell from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetVisualSilence

func (s GlobalSessionScope) SetVisualSilence(ctx context.Context, value VisualSilence) error

SetVisualSilence stores the "visual-silence" session option, available since tmux 3.2a. It accepts VisualSilence and does not expose raw set-option flags. Read it back with SessionOptionValues.VisualSilence from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) SetWordSeparators

func (s GlobalSessionScope) SetWordSeparators(ctx context.Context, value string) error

SetWordSeparators stores the "word-separators" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.WordSeparators from GlobalSessionScope.Options, and GlobalSessionScope.UnsetOption restores inheritance or the global default. Use GlobalSessionScope.SetOption for caller-named options or raw values.

func (GlobalSessionScope) UnsetHook

func (s GlobalSessionScope) UnsetHook(ctx context.Context, name string) error

UnsetHook removes every matching global session-scope hook index without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the unset.

func (GlobalSessionScope) UnsetOption

func (s GlobalSessionScope) UnsetOption(
	ctx context.Context,
	name string,
	options UnsetOptionOptions,
) error

UnsetOption unsets a global session option without refreshing models. UnsetPanes is invalid at this scope; cancellation does not prove the unset was not accepted.

type GlobalWindowScope

type GlobalWindowScope struct {
	// contains filtered or unexported fields
}

GlobalWindowScope is an immutable handle for global window options and hooks. Its zero value uses the zero Server and tmux's default connection.

func (GlobalWindowScope) AppendHook

func (s GlobalWindowScope) AppendHook(ctx context.Context, name string, command string) error

AppendHook appends a command to a global window hook without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the append.

func (GlobalWindowScope) AppendOption

func (s GlobalWindowScope) AppendOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

AppendOption appends to a global window option without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.

func (GlobalWindowScope) Hooks

Hooks returns a freshly decoded, caller-owned view of known global window hooks, including defaults. A read failure is returned rather than answered with zero values; context errors propagate.

func (GlobalWindowScope) Options

Options returns a freshly decoded, caller-owned view of known global window options, including defaults. A read failure is returned rather than answered with zero values; context errors propagate. Each returned accessor names the setter that writes it, so WindowOptionValues.MainPaneWidth pairs with GlobalWindowScope.SetMainPaneWidth.

func (GlobalWindowScope) RawHook

func (s GlobalWindowScope) RawHook(
	ctx context.Context,
	name string,
) (string, bool, error)

RawHook returns one exact global window-hook value. A successful string is caller-owned; ok reports presence and completed failures are returned. An unindexed empty hook array is ambiguous; use Hooks for typed presence.

func (GlobalWindowScope) RawOption

func (s GlobalWindowScope) RawOption(
	ctx context.Context,
	name string,
) (string, bool, error)

RawOption returns one exact global window-option value. A successful string is caller-owned, and ok reports presence. An unindexed empty array is indistinguishable from an empty scalar; use Options for typed array presence.

func (GlobalWindowScope) RunHook

func (s GlobalWindowScope) RunHook(ctx context.Context, name string) error

RunHook asks tmux to run one global window hook directly. It targets global window scope rather than a receiver, returns secret-safe option errors for completed failures, and cancellation does not prove hook delivery or execution did not occur.

func (GlobalWindowScope) SetAggressiveResize

func (s GlobalWindowScope) SetAggressiveResize(ctx context.Context, value bool) error

SetAggressiveResize stores the "aggressive-resize" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AggressiveResize from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetAllowPassthrough

func (s GlobalWindowScope) SetAllowPassthrough(ctx context.Context, value AllowPassthrough) error

SetAllowPassthrough stores the "allow-passthrough" window option, available since tmux 3.3. It accepts AllowPassthrough and does not expose raw set-option flags. Read it back with WindowOptionValues.AllowPassthrough from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetAllowRename

func (s GlobalWindowScope) SetAllowRename(ctx context.Context, value bool) error

SetAllowRename stores the "allow-rename" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AllowRename from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetAllowSetTitle

func (s GlobalWindowScope) SetAllowSetTitle(ctx context.Context, value bool) error

SetAllowSetTitle stores the "allow-set-title" window option, available since tmux 3.5. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AllowSetTitle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetAlternateScreen

func (s GlobalWindowScope) SetAlternateScreen(ctx context.Context, value bool) error

SetAlternateScreen stores the "alternate-screen" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AlternateScreen from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetAutomaticRename

func (s GlobalWindowScope) SetAutomaticRename(ctx context.Context, value bool) error

SetAutomaticRename stores the "automatic-rename" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AutomaticRename from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetAutomaticRenameFormat

func (s GlobalWindowScope) SetAutomaticRenameFormat(ctx context.Context, value string) error

SetAutomaticRenameFormat stores the "automatic-rename-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.AutomaticRenameFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetClockModeColour

func (s GlobalWindowScope) SetClockModeColour(ctx context.Context, value string) error

SetClockModeColour stores the "clock-mode-colour" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.ClockModeColour from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetClockModeStyle

func (s GlobalWindowScope) SetClockModeStyle(ctx context.Context, value ClockModeStyle) error

SetClockModeStyle stores the "clock-mode-style" window option, available since tmux 3.2a. It accepts ClockModeStyle and does not expose raw set-option flags. Read it back with WindowOptionValues.ClockModeStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeCurrentLineNumberStyle

func (s GlobalWindowScope) SetCopyModeCurrentLineNumberStyle(ctx context.Context, value string) error

SetCopyModeCurrentLineNumberStyle stores the "copy-mode-current-line-number-style" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeCurrentLineNumberStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeCurrentMatchStyle

func (s GlobalWindowScope) SetCopyModeCurrentMatchStyle(ctx context.Context, value string) error

SetCopyModeCurrentMatchStyle stores the "copy-mode-current-match-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeCurrentMatchStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeLineNumberStyle

func (s GlobalWindowScope) SetCopyModeLineNumberStyle(ctx context.Context, value string) error

SetCopyModeLineNumberStyle stores the "copy-mode-line-number-style" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeLineNumberStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeLineNumbers

func (s GlobalWindowScope) SetCopyModeLineNumbers(ctx context.Context, value CopyModeLineNumbers) error

SetCopyModeLineNumbers stores the "copy-mode-line-numbers" window option, available since tmux 3.7. It accepts CopyModeLineNumbers and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeLineNumbers from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeMarkStyle

func (s GlobalWindowScope) SetCopyModeMarkStyle(ctx context.Context, value string) error

SetCopyModeMarkStyle stores the "copy-mode-mark-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeMarkStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeMatchStyle

func (s GlobalWindowScope) SetCopyModeMatchStyle(ctx context.Context, value string) error

SetCopyModeMatchStyle stores the "copy-mode-match-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeMatchStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModePositionFormat

func (s GlobalWindowScope) SetCopyModePositionFormat(ctx context.Context, value string) error

SetCopyModePositionFormat stores the "copy-mode-position-format" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModePositionFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModePositionStyle

func (s GlobalWindowScope) SetCopyModePositionStyle(ctx context.Context, value string) error

SetCopyModePositionStyle stores the "copy-mode-position-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModePositionStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCopyModeSelectionStyle

func (s GlobalWindowScope) SetCopyModeSelectionStyle(ctx context.Context, value string) error

SetCopyModeSelectionStyle stores the "copy-mode-selection-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeSelectionStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCursorColour

func (s GlobalWindowScope) SetCursorColour(ctx context.Context, value string) error

SetCursorColour stores the "cursor-colour" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CursorColour from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetCursorStyle

func (s GlobalWindowScope) SetCursorStyle(ctx context.Context, value CursorStyle) error

SetCursorStyle stores the "cursor-style" window option, available since tmux 3.3. It accepts CursorStyle and does not expose raw set-option flags. Read it back with WindowOptionValues.CursorStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetFillCharacter

func (s GlobalWindowScope) SetFillCharacter(ctx context.Context, value string) error

SetFillCharacter stores the "fill-character" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.FillCharacter from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetHook

func (s GlobalWindowScope) SetHook(ctx context.Context, name string, command string) error

SetHook stores a global window hook without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (GlobalWindowScope) SetHooks

func (s GlobalWindowScope) SetHooks(
	ctx context.Context,
	name string,
	values SparseArray[string],
	options SetHooksOptions,
) (SetHooksResult, error)

SetHooks applies indexed global window-hook commands in ascending order. With ClearExisting it confirms clearing before applying sparse Values, stops at the first failure without rollback, and reports confirmed progress. Cancellation may follow accepted commands and cannot disprove their delivery.

func (GlobalWindowScope) SetMainPaneHeight

func (s GlobalWindowScope) SetMainPaneHeight(ctx context.Context, value string) error

SetMainPaneHeight stores the "main-pane-height" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MainPaneHeight from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMainPaneWidth

func (s GlobalWindowScope) SetMainPaneWidth(ctx context.Context, value string) error

SetMainPaneWidth stores the "main-pane-width" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MainPaneWidth from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMenuBorderLines

func (s GlobalWindowScope) SetMenuBorderLines(ctx context.Context, value MenuBorderLines) error

SetMenuBorderLines stores the "menu-border-lines" window option, available since tmux 3.4. It accepts MenuBorderLines and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuBorderLines from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMenuBorderStyle

func (s GlobalWindowScope) SetMenuBorderStyle(ctx context.Context, value string) error

SetMenuBorderStyle stores the "menu-border-style" window option, available since tmux 3.4. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuBorderStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMenuSelectedStyle

func (s GlobalWindowScope) SetMenuSelectedStyle(ctx context.Context, value string) error

SetMenuSelectedStyle stores the "menu-selected-style" window option, available since tmux 3.4. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuSelectedStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMenuStyle

func (s GlobalWindowScope) SetMenuStyle(ctx context.Context, value string) error

SetMenuStyle stores the "menu-style" window option, available since tmux 3.4. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetModeKeys

func (s GlobalWindowScope) SetModeKeys(ctx context.Context, value ModeKeys) error

SetModeKeys stores the "mode-keys" window option, available since tmux 3.2a. It accepts ModeKeys and does not expose raw set-option flags. Read it back with WindowOptionValues.ModeKeys from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetModeStyle

func (s GlobalWindowScope) SetModeStyle(ctx context.Context, value string) error

SetModeStyle stores the "mode-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.ModeStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMonitorActivity

func (s GlobalWindowScope) SetMonitorActivity(ctx context.Context, value bool) error

SetMonitorActivity stores the "monitor-activity" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.MonitorActivity from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMonitorBell

func (s GlobalWindowScope) SetMonitorBell(ctx context.Context, value bool) error

SetMonitorBell stores the "monitor-bell" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.MonitorBell from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetMonitorSilence

func (s GlobalWindowScope) SetMonitorSilence(ctx context.Context, value int64) error

SetMonitorSilence stores the "monitor-silence" window option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with WindowOptionValues.MonitorSilence from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetOption

func (s GlobalWindowScope) SetOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

SetOption stores a global window option without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (GlobalWindowScope) SetOtherPaneHeight

func (s GlobalWindowScope) SetOtherPaneHeight(ctx context.Context, value string) error

SetOtherPaneHeight stores the "other-pane-height" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.OtherPaneHeight from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetOtherPaneWidth

func (s GlobalWindowScope) SetOtherPaneWidth(ctx context.Context, value string) error

SetOtherPaneWidth stores the "other-pane-width" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.OtherPaneWidth from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneActiveBorderStyle

func (s GlobalWindowScope) SetPaneActiveBorderStyle(ctx context.Context, value string) error

SetPaneActiveBorderStyle stores the "pane-active-border-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneActiveBorderStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneBaseIndex

func (s GlobalWindowScope) SetPaneBaseIndex(ctx context.Context, value int64) error

SetPaneBaseIndex stores the "pane-base-index" window option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBaseIndex from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneBorderFormat

func (s GlobalWindowScope) SetPaneBorderFormat(ctx context.Context, value string) error

SetPaneBorderFormat stores the "pane-border-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneBorderIndicators

func (s GlobalWindowScope) SetPaneBorderIndicators(ctx context.Context, value PaneBorderIndicators) error

SetPaneBorderIndicators stores the "pane-border-indicators" window option, available since tmux 3.3. It accepts PaneBorderIndicators and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderIndicators from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneBorderLines

func (s GlobalWindowScope) SetPaneBorderLines(ctx context.Context, value PaneBorderLines) error

SetPaneBorderLines stores the "pane-border-lines" window option, available since tmux 3.2a. It accepts PaneBorderLines and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderLines from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneBorderStatus

func (s GlobalWindowScope) SetPaneBorderStatus(ctx context.Context, value PaneBorderStatus) error

SetPaneBorderStatus stores the "pane-border-status" window option, available since tmux 3.2a. It accepts PaneBorderStatus and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderStatus from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneBorderStyle

func (s GlobalWindowScope) SetPaneBorderStyle(ctx context.Context, value string) error

SetPaneBorderStyle stores the "pane-border-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneColours

func (s GlobalWindowScope) SetPaneColours(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetPaneColours performs a complete replacement of the "pane-colours" window option, available since tmux 3.3. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneColours from GlobalWindowScope.Options. Use GlobalWindowScope.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use GlobalWindowScope.UnsetOption to restore inheritance or the global default.

func (GlobalWindowScope) SetPaneScrollbars

func (s GlobalWindowScope) SetPaneScrollbars(ctx context.Context, value PaneScrollbars) error

SetPaneScrollbars stores the "pane-scrollbars" window option, available since tmux 3.6. It accepts PaneScrollbars and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneScrollbars from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneScrollbarsPosition

func (s GlobalWindowScope) SetPaneScrollbarsPosition(ctx context.Context, value PaneScrollbarsPosition) error

SetPaneScrollbarsPosition stores the "pane-scrollbars-position" window option, available since tmux 3.6. It accepts PaneScrollbarsPosition and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneScrollbarsPosition from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneScrollbarsStyle

func (s GlobalWindowScope) SetPaneScrollbarsStyle(ctx context.Context, value string) error

SetPaneScrollbarsStyle stores the "pane-scrollbars-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneScrollbarsStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneStatusCurrentStyle

func (s GlobalWindowScope) SetPaneStatusCurrentStyle(ctx context.Context, value string) error

SetPaneStatusCurrentStyle stores the "pane-status-current-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneStatusCurrentStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPaneStatusStyle

func (s GlobalWindowScope) SetPaneStatusStyle(ctx context.Context, value string) error

SetPaneStatusStyle stores the "pane-status-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneStatusStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPopupBorderLines

func (s GlobalWindowScope) SetPopupBorderLines(ctx context.Context, value PopupBorderLines) error

SetPopupBorderLines stores the "popup-border-lines" window option, available since tmux 3.3. It accepts PopupBorderLines and does not expose raw set-option flags. Read it back with WindowOptionValues.PopupBorderLines from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPopupBorderStyle

func (s GlobalWindowScope) SetPopupBorderStyle(ctx context.Context, value string) error

SetPopupBorderStyle stores the "popup-border-style" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PopupBorderStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetPopupStyle

func (s GlobalWindowScope) SetPopupStyle(ctx context.Context, value string) error

SetPopupStyle stores the "popup-style" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PopupStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetRemainOnExit

func (s GlobalWindowScope) SetRemainOnExit(ctx context.Context, value RemainOnExit) error

SetRemainOnExit stores the "remain-on-exit" window option, available since tmux 3.2a. It accepts RemainOnExit and does not expose raw set-option flags. Read it back with WindowOptionValues.RemainOnExit from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetRemainOnExitFormat

func (s GlobalWindowScope) SetRemainOnExitFormat(ctx context.Context, value string) error

SetRemainOnExitFormat stores the "remain-on-exit-format" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.RemainOnExitFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetScrollOnClear

func (s GlobalWindowScope) SetScrollOnClear(ctx context.Context, value bool) error

SetScrollOnClear stores the "scroll-on-clear" window option, available since tmux 3.3. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.ScrollOnClear from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetSessionStatusCurrentStyle

func (s GlobalWindowScope) SetSessionStatusCurrentStyle(ctx context.Context, value string) error

SetSessionStatusCurrentStyle stores the "session-status-current-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.SessionStatusCurrentStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetSessionStatusStyle

func (s GlobalWindowScope) SetSessionStatusStyle(ctx context.Context, value string) error

SetSessionStatusStyle stores the "session-status-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.SessionStatusStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetSynchronizePanes

func (s GlobalWindowScope) SetSynchronizePanes(ctx context.Context, value bool) error

SetSynchronizePanes stores the "synchronize-panes" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.SynchronizePanes from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetTiledLayoutMaxColumns

func (s GlobalWindowScope) SetTiledLayoutMaxColumns(ctx context.Context, value int64) error

SetTiledLayoutMaxColumns stores the "tiled-layout-max-columns" window option, available since tmux 3.6. It accepts int64 and does not expose raw set-option flags. Read it back with WindowOptionValues.TiledLayoutMaxColumns from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetTreeModePreviewFormat

func (s GlobalWindowScope) SetTreeModePreviewFormat(ctx context.Context, value string) error

SetTreeModePreviewFormat stores the "tree-mode-preview-format" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.TreeModePreviewFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetTreeModePreviewStyle

func (s GlobalWindowScope) SetTreeModePreviewStyle(ctx context.Context, value string) error

SetTreeModePreviewStyle stores the "tree-mode-preview-style" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.TreeModePreviewStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowActiveStyle

func (s GlobalWindowScope) SetWindowActiveStyle(ctx context.Context, value string) error

SetWindowActiveStyle stores the "window-active-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowActiveStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowPaneCurrentStatusFormat

func (s GlobalWindowScope) SetWindowPaneCurrentStatusFormat(ctx context.Context, value string) error

SetWindowPaneCurrentStatusFormat stores the "window-pane-current-status-format" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowPaneCurrentStatusFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowPaneStatusFormat

func (s GlobalWindowScope) SetWindowPaneStatusFormat(ctx context.Context, value string) error

SetWindowPaneStatusFormat stores the "window-pane-status-format" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowPaneStatusFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowSize

func (s GlobalWindowScope) SetWindowSize(ctx context.Context, value WindowSize) error

SetWindowSize stores the "window-size" window option, available since tmux 3.2a. It accepts WindowSize and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowSize from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusActivityStyle

func (s GlobalWindowScope) SetWindowStatusActivityStyle(ctx context.Context, value string) error

SetWindowStatusActivityStyle stores the "window-status-activity-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusActivityStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusBellStyle

func (s GlobalWindowScope) SetWindowStatusBellStyle(ctx context.Context, value string) error

SetWindowStatusBellStyle stores the "window-status-bell-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusBellStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusCurrentFormat

func (s GlobalWindowScope) SetWindowStatusCurrentFormat(ctx context.Context, value string) error

SetWindowStatusCurrentFormat stores the "window-status-current-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusCurrentFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusCurrentStyle

func (s GlobalWindowScope) SetWindowStatusCurrentStyle(ctx context.Context, value string) error

SetWindowStatusCurrentStyle stores the "window-status-current-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusCurrentStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusFormat

func (s GlobalWindowScope) SetWindowStatusFormat(ctx context.Context, value string) error

SetWindowStatusFormat stores the "window-status-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusFormat from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusLastStyle

func (s GlobalWindowScope) SetWindowStatusLastStyle(ctx context.Context, value string) error

SetWindowStatusLastStyle stores the "window-status-last-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusLastStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusSeparator

func (s GlobalWindowScope) SetWindowStatusSeparator(ctx context.Context, value string) error

SetWindowStatusSeparator stores the "window-status-separator" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusSeparator from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStatusStyle

func (s GlobalWindowScope) SetWindowStatusStyle(ctx context.Context, value string) error

SetWindowStatusStyle stores the "window-status-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWindowStyle

func (s GlobalWindowScope) SetWindowStyle(ctx context.Context, value string) error

SetWindowStyle stores the "window-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStyle from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetWrapSearch

func (s GlobalWindowScope) SetWrapSearch(ctx context.Context, value bool) error

SetWrapSearch stores the "wrap-search" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.WrapSearch from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) SetXTermKeys

func (s GlobalWindowScope) SetXTermKeys(ctx context.Context, value bool) error

SetXTermKeys stores the "xterm-keys" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.XTermKeys from GlobalWindowScope.Options, and GlobalWindowScope.UnsetOption restores inheritance or the global default. Use GlobalWindowScope.SetOption for caller-named options or raw values.

func (GlobalWindowScope) UnsetHook

func (s GlobalWindowScope) UnsetHook(ctx context.Context, name string) error

UnsetHook removes every matching global window-hook index without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the unset.

func (GlobalWindowScope) UnsetOption

func (s GlobalWindowScope) UnsetOption(
	ctx context.Context,
	name string,
	options UnsetOptionOptions,
) error

UnsetOption unsets a global window option without refreshing models. UnsetPanes is invalid at this scope; cancellation does not prove the unset was not accepted.

type HasSessionRequest

type HasSessionRequest struct {
	// Target is the required session name or tmux session pattern.
	Target string
	// Pattern lets tmux interpret Target as a pattern; false requires an exact
	// session name.
	Pattern bool
}

HasSessionRequest selects exact or tmux-pattern session matching on tmux 3.2a or later. Its zero value is invalid because Target is required. Pattern is checked after local target validation and before execution; the request contains no retained caller-owned storage.

type IfShellRequest

type IfShellRequest struct {
	// ShellCommand is the required shell condition executed by tmux.
	ShellCommand string
	// ThenCommand is the required tmux command executed when ShellCommand succeeds.
	ThenCommand string
	// ElseCommand is the optional tmux command executed when ShellCommand fails.
	ElseCommand *string
	// Background makes tmux schedule the conditional command without waiting.
	Background bool
	// TargetPane selects a stable pane target; its zero value omits -t.
	TargetPane PaneID
}

IfShellRequest configures conditional execution of a tmux command. Its zero value is invalid because ShellCommand and ThenCommand are required; nil ElseCommand omits the failure branch while a pointer to an empty string is explicit.

type InstanceBoundEngine

type InstanceBoundEngine interface {
	// InstanceBound reports whether consecutive commands this engine carried
	// provably reached one tmux server instance.
	InstanceBound() bool
}

InstanceBoundEngine is an optional interface an Engine may implement to report that its transport cannot outlive the tmux server instance it talks to. A connection is bound: tmux gives a client no way to survive its server, so a client that answers at all answers from the instance it was opened against, and a replacement server on the same socket cannot be reached through it. A tmux process is not bound, because each one connects afresh and two of them may reach two servers that owned the socket in turn.

Snapshot reads use it to skip a second identity probe whose only job is to prove what a bound transport already guarantees. An engine that does not implement it, or reports false, is read exactly as before.

An engine that wraps another must forward this, or the transport underneath silently loses the property and pays for the probe again.

type JoinPaneRequest

type JoinPaneRequest struct {
	// TargetPane selects an exact destination pane; a zero Pane omits it.
	TargetPane Pane
	// TargetWindow selects an exact destination winlink; a zero Window omits it.
	TargetWindow Window
	// Attach lets tmux make the joined pane active in the destination winlink.
	Attach bool
	// Direction selects placement relative to the destination; zero means below.
	Direction PaneDirection
	// FullWindow lets the joined pane span the full destination window.
	FullWindow bool
	// Size selects a nonnegative absolute pane size; nil omits it.
	Size *int
	// Percentage selects a size from 0 through 100; nil omits it.
	Percentage *int
}

JoinPaneRequest configures join-pane on tmux 3.2a or later. Its zero value is invalid: exactly one complete TargetPane or TargetWindow handle is required. Cross-object handles must be proven to share a daemon through connection state or the same nonempty SocketPath; matching socket names alone are insufficient. Size and Percentage are mutually exclusive. Invalid enum, target, size, and percentage values are rejected before execution.

Pointer values are read during the call and retained nowhere; nil omits a size mode, a nonnil pointer is explicit, and callers must not mutate it concurrently. Other request values are copied for the call and not retained.

type KillWindowRequest

type KillWindowRequest struct {
	// Target is passed through as unrestricted tmux target syntax when nonnil.
	Target *string
	// Index selects a winlink index within the receiver session when nonnil.
	Index *int
}

KillWindowRequest selects a window for Session.KillWindow on tmux 3.2a or later. A zero request kills the receiver session's current window, and Index is scoped to that session. Target is unrestricted tmux target syntax and may select a window in another session. Target and Index are mutually exclusive and are checked before execution. Pointer values are read during the call and are not retained; callers must not mutate them concurrently. A nil pointer omits its selector, while a nonnil pointer is explicit even when Target points to an empty string.

type LastPaneRequest

type LastPaneRequest struct {
	// Input changes the previous pane's input state; zero performs selection.
	Input PaneInputMode
	// KeepZoom preserves the window's zoomed state during selection.
	KeepZoom bool
}

LastPaneRequest configures last-pane on tmux 3.2a or later. Its zero value selects the previously active pane. Input and KeepZoom are mutually exclusive and are validated before execution; an Input mode changes the previous pane's input state without selecting it. The request contains no retained caller-owned storage.

type LinkWindowRequest

type LinkWindowRequest struct {
	// TargetSession identifies the destination session in the receiver's tmux
	// server.
	TargetSession SessionID
	// TargetIndex selects a destination winlink index; nil lets tmux choose.
	TargetIndex *int
	// KillExisting destroys a window already occupying the destination.
	KillExisting bool
	// After inserts the new winlink after the destination target.
	After bool
	// Before inserts the new winlink before the destination target.
	Before bool
	// Detach leaves the target session's current window unchanged.
	Detach bool
}

LinkWindowRequest configures linking a window into another session on tmux 3.2a or later. Its zero value is invalid because TargetSession is required. Nil TargetIndex asks tmux for a destination index; a nonnil value is explicit and must be nonnegative. After and Before are mutually exclusive and are rejected before execution. TargetIndex is read during the call and is not retained; callers must not mutate it concurrently.

type ListBuffersRequest

type ListBuffersRequest struct {
	// Format selects tmux's output format.
	Format *string
	// Filter is a raw tmux filter expression evaluated by tmux.
	Filter *TmuxFilter
}

ListBuffersRequest configures tmux's live paste-buffer listing. Its zero value requests tmux's default output; nil Format and Filter omit their flags, whereas pointers to empty strings are explicit expressions.

type ListCommandsRequest

type ListCommandsRequest struct {
	// CommandName optionally selects one command or alias.
	CommandName *string
}

ListCommandsRequest optionally limits output to one tmux command or alias. Nil CommandName lists all commands; a pointer to an empty name is explicit.

type ListKeysRequest

type ListKeysRequest struct {
	// KeyTable limits output to one key table.
	KeyTable *string
	// Format selects output format; tmux before 3.7 refuses it; see UnsupportedPolicy.
	Format *string
}

ListKeysRequest configures raw key-binding output. Its zero value selects tmux's default table and format; nil fields omit flags while explicit empty pointers are passed to tmux.

type LoadBufferRequest

type LoadBufferRequest struct {
	// Path is the required input file path.
	Path string
	// Name selects the destination buffer, or nil for tmux's allocation behavior.
	Name *string
}

LoadBufferRequest configures loading a file into a tmux paste buffer. Its zero value is invalid because Path is required; nil Name lets tmux allocate a buffer and a pointer to an empty name is explicit.

type Marked

type Marked struct{}

Marked folds a pane creation together with the operations that decorate it, which Folding cannot: those operations name the new pane, and its ID is not known until the creation has run.

It uses tmux's own answer. The creation leaves its pane active, so select-pane -m marks it, the operations after it address {marked}, and a final select-pane -M clears the mark -- all in one command list. Everything else folds as Folding does.

It applies only to a creation that leaves its new pane active. A detached one does not, so marking would name whichever pane was already active, and those creations are left to dispatch alone.

func (Marked) Plan

func (Marked) Plan(ops []Op) []Dispatch

Plan returns the dispatches for ops, folding a marked creation with the operations that name it.

type MenuBorderLines string

MenuBorderLines is a typed value for the "menu-border-lines" tmux option. Its zero value is invalid.

const (
	// MenuBorderLinesSingle selects "single".
	MenuBorderLinesSingle MenuBorderLines = "single"
	// MenuBorderLinesDouble selects "double".
	MenuBorderLinesDouble MenuBorderLines = "double"
	// MenuBorderLinesHeavy selects "heavy".
	MenuBorderLinesHeavy MenuBorderLines = "heavy"
	// MenuBorderLinesSimple selects "simple".
	MenuBorderLinesSimple MenuBorderLines = "simple"
	// MenuBorderLinesRounded selects "rounded".
	MenuBorderLinesRounded MenuBorderLines = "rounded"
	// MenuBorderLinesPadded selects "padded".
	MenuBorderLinesPadded MenuBorderLines = "padded"
	// MenuBorderLinesNone selects "none".
	MenuBorderLinesNone MenuBorderLines = "none"
)
func (v MenuBorderLines) String() string

String returns the exact tmux spelling of v.

func (v MenuBorderLines) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type MenuItem struct {
	// Name is the visible item name; an empty name makes this item a separator.
	Name string
	// Key is the optional shortcut for a named item.
	Key string
	// Command is the tmux command for a named item.
	Command string
}

MenuItem is one display-menu entry. Its zero value is a separator. A named item always contributes its name, key, and command to tmux, including empty key or command strings.

type MessageLine

type MessageLine string

MessageLine is a typed value for the "message-line" tmux option. Its zero value is invalid.

const (
	// MessageLine0 selects "0".
	MessageLine0 MessageLine = "0"
	// MessageLine1 selects "1".
	MessageLine1 MessageLine = "1"
	// MessageLine2 selects "2".
	MessageLine2 MessageLine = "2"
	// MessageLine3 selects "3".
	MessageLine3 MessageLine = "3"
	// MessageLine4 selects "4".
	MessageLine4 MessageLine = "4"
)

func (MessageLine) String

func (v MessageLine) String() string

String returns the exact tmux spelling of v.

func (MessageLine) Valid

func (v MessageLine) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type ModeKeys

type ModeKeys string

ModeKeys is a typed value for the "mode-keys" tmux option. Its zero value is invalid.

const (
	// ModeKeysEmacs selects "emacs".
	ModeKeysEmacs ModeKeys = "emacs"
	// ModeKeysVi selects "vi".
	ModeKeysVi ModeKeys = "vi"
)

func (ModeKeys) String

func (v ModeKeys) String() string

String returns the exact tmux spelling of v.

func (ModeKeys) Valid

func (v ModeKeys) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type MovePaneRequest

type MovePaneRequest struct {
	// TargetPane selects an exact destination pane; a zero Pane omits it.
	TargetPane Pane
	// TargetWindow selects an exact destination winlink; a zero Window omits it.
	TargetWindow Window
	// Attach lets tmux make the moved pane active in the destination winlink.
	Attach bool
	// Direction selects placement relative to the destination; zero means below.
	Direction PaneDirection
	// FullWindow lets the moved pane span the full destination window.
	FullWindow bool
	// Size selects a nonnegative absolute pane size; nil omits it.
	Size *int
	// Percentage selects a size from 0 through 100; nil omits it.
	Percentage *int
}

MovePaneRequest configures move-pane on tmux 3.2a or later. Its zero value is invalid: exactly one complete TargetPane or TargetWindow handle is required. Cross-object handles must be proven to share a daemon through connection state or the same nonempty SocketPath; matching socket names alone are insufficient. Size and Percentage are mutually exclusive. Invalid enum, target, size, and percentage values are rejected before execution.

Pointer values are read during the call and retained nowhere; nil omits a size mode, a nonnil pointer is explicit, and callers must not mutate it concurrently. Other request values are copied for the call and not retained.

type MoveWindowRequest

type MoveWindowRequest struct {
	// TargetSession identifies the destination session; zero uses the receiver
	// session.
	TargetSession SessionID
	// TargetIndex selects a destination winlink index; nil lets tmux choose.
	TargetIndex *int
	// After inserts the moved winlink after the destination target.
	After bool
	// Before inserts the moved winlink before the destination target.
	Before bool
	// NoSelect leaves the destination session's current window unchanged.
	NoSelect bool
	// KillTarget destroys a window already occupying the destination.
	KillTarget bool
	// Renumber renumbers the target session according to its base-index option
	// instead of moving the receiver to a new destination.
	Renumber bool
}

MoveWindowRequest configures moving one exact winlink on tmux 3.2a or later. Its zero value moves the receiver within its current session to a tmux-chosen index and lets the moved winlink become current. Nil TargetIndex asks tmux for that index; a nonnil value is explicit and must be nonnegative. After and Before are mutually exclusive. Renumber is a standalone mode mutually exclusive with TargetIndex, After, Before, NoSelect, and KillTarget. Invalid combinations are rejected before execution. TargetIndex is read during the call and is not retained; callers must not mutate it concurrently.

type NewPaneRequest

type NewPaneRequest struct {
	// Attach lets the created pane become active in the exact target winlink;
	// false preserves its active pane.
	Attach bool
	// StartDirectory expands ~ and ~/... for the current user. Named-user
	// forms such as ~other are rejected; empty inherits tmux's default.
	StartDirectory string
	// Command starts the pane with this shell command; empty uses tmux's default.
	Command string
	// Environment is emitted in lexically sorted key order. The map is not
	// retained; nil and an empty map both add no entries.
	Environment map[string]string
	// Width sets a nonnegative pane width; nil lets tmux choose.
	Width *int
	// Height sets a nonnegative pane height; nil lets tmux choose.
	Height *int
	// X sets the horizontal position; nil lets tmux choose.
	X *int
	// Y sets the vertical position; nil lets tmux choose.
	Y *int
	// Zoom preserves the target window's zoomed state.
	Zoom bool
	// Empty creates a pane without starting a command.
	Empty bool
	// Style sets the pane style; nil omits it.
	Style *string
	// ActiveBorderStyle sets the active border style; nil omits it.
	ActiveBorderStyle *string
	// InactiveBorderStyle sets the inactive border style; nil omits it.
	InactiveBorderStyle *string
	// Message sets the pane message; nil omits it.
	Message *string
	// Keep preserves the pane after its command exits.
	Keep bool
}

NewPaneRequest configures a floating pane and requires tmux 3.7 or later. Its zero value creates a detached floating pane with tmux's default size, position, styles, and command. Nil pointer fields omit their options; nonnil pointers are explicit, including empty style or message strings. Width and Height must be nonnegative. Empty and Command are mutually exclusive and are rejected before the hard version check; unsupported tmux versions return a VersionTooLowError matching ErrVersionTooLow rather than omitting requested features.

Window.NewPane and Pane.NewPane copy every pointer and Environment before validation or the version probe and retain none of that storage. Mutation after the copy completes cannot affect the call, but mutation during the copy is not race-safe.

type NewSessionRequest

type NewSessionRequest struct {
	// Name selects the new session name; empty lets tmux generate one.
	Name string
	// KillExisting removes an existing session named Name before creation.
	KillExisting bool
	// StartDirectory expands ~ and ~/... for the current user. Named-user
	// forms such as ~other are rejected; empty inherits tmux's default.
	StartDirectory string
	// WindowName names the initial window; empty lets tmux choose.
	WindowName string
	// Width sets the detached session width; zero lets tmux choose.
	Width int
	// Height sets the detached session height; zero lets tmux choose.
	Height int
	// Environment is emitted in lexically sorted key order. The map is not
	// retained; nil and an empty map both add no entries.
	Environment map[string]string
	// Command starts the initial pane with this shell command; empty uses tmux's
	// default command.
	Command string
}

NewSessionRequest configures detached session creation on tmux 3.2a or later. Its zero value creates an automatically named detached session with tmux defaults. Zero Width and Height omit those flags; nonzero values must be between 1 and 65535. KillExisting requires Name. Local validation completes before tmux is mutated, except that a named request probes for an existing session and KillExisting may remove it before later creation fails.

Server.NewSession copies Environment before validation and the existence probe, then retains none of the caller's request storage. The caller may mutate the map after the copy completes, but mutation during the copy is not race-safe. Foreground attach requires a stdio/control transport and is not represented by this blocking subprocess API. tmux consumes -D, -X, and -f only while attaching a client, including new-session -A, so this always-detached request does not expose them.

type NewWindowDirection

type NewWindowDirection uint8

NewWindowDirection selects placement relative to the target winlink on tmux 3.2a or later. Its zero value lets Session.NewWindow with nil Index use the next free index, while Window.NewWindow keeps the receiver's exact occupied target.

const (
	// NewWindowDirectionDefault uses the next free index with Session.NewWindow
	// when Index is nil; Window.NewWindow instead keeps the receiver's exact
	// occupied target.
	NewWindowDirectionDefault NewWindowDirection = iota
	// NewWindowDirectionAfter places the new winlink after the target.
	NewWindowDirectionAfter
	// NewWindowDirectionBefore places the new winlink before the target.
	NewWindowDirectionBefore
)

Supported new-window placements.

type NewWindowRequest

type NewWindowRequest struct {
	// Name is omitted when nil. A nonnil empty string remains an explicit
	// -n operand. The value is copied before tmux is called.
	Name *string
	// Attach lets the created or selected winlink become current in the target
	// session; false preserves its current window.
	Attach bool
	// Index selects an explicit nonnegative winlink index for
	// Session.NewWindow; nil uses the next free index.
	Index *int
	// StartDirectory expands ~ and ~/... for the current user. Named-user
	// forms such as ~other are rejected; empty inherits tmux's default.
	StartDirectory string
	// Command starts the window with this shell command; empty uses tmux's
	// default command.
	Command string
	// Environment is emitted in lexically sorted key order. The map is not
	// retained; nil and an empty map both add no entries.
	Environment map[string]string
	// Direction places the new winlink relative to the target. Its zero value
	// uses tmux's next free index with Session.NewWindow when Index is nil, but
	// keeps Window.NewWindow on the receiver's occupied target. Use
	// NewWindowDirectionAfter or NewWindowDirectionBefore for non-destructive
	// relative creation through Window.NewWindow.
	Direction NewWindowDirection
	// KillExisting asks tmux to destroy a window occupying the target index.
	KillExisting bool
	// SelectExisting asks tmux to select an existing expanded-name match instead
	// of creating another window. It requires Name.
	SelectExisting bool
}

NewWindowRequest configures window creation on tmux 3.2a or later. Its zero value uses inherited defaults; placement behavior depends on the receiver. Session.NewWindow uses tmux's next free index. Window.NewWindow instead targets the receiver's occupied index and normally returns a command error; with KillExisting, tmux destroys and replaces that target if it is still occupied. Nil pointer fields omit their options; nonnil pointers are explicit, including an empty Name. Window.NewWindow rejects Index because its receiver already supplies the exact winlink. Other invalid values are rejected before creation; SelectExisting's name-expansion probes can run before the create command.

Session.NewWindow and Window.NewWindow copy Name, Index, and Environment before validation or later probes and retain none of that storage. Mutation after the copy completes cannot affect the call, but mutation during the copy is not race-safe.

type Op

type Op struct {
	// contains filtered or unexported fields
}

Op is one tmux command a Plan has recorded but not run. Build one with a Plan method rather than directly; the zero value records nothing.

func (Op) Chainable

func (o Op) Chainable() bool

Chainable reports whether the operation may share a tmux invocation with others, which is what a Planner groups on.

func (Op) Command

func (o Op) Command() string

Command returns the tmux command the operation records.

type OpResult

type OpResult struct {
	// Command is the tmux command the operation recorded.
	Command string
	// Status reports what became of the operation.
	Status OpStatus
	// Created is the ID tmux reported for an object this operation brought into
	// being, and is empty for every other operation.
	Created string
	// Stdout holds the operation's output, for an operation that captures it.
	Stdout []string
	// Err is the failure, for a failed operation.
	Err error
}

OpResult is what one operation in a Plan produced.

type OpStatus

type OpStatus uint8

OpStatus reports what became of one operation in a plan.

const (
	// OpComplete is an operation tmux ran successfully.
	OpComplete OpStatus = iota
	// OpFailed is an operation tmux refused, or the first operation of a
	// dispatch one of whose commands tmux refused. tmux reports one status for
	// a command list without naming the command that produced it, so this is
	// exact only for a dispatch carrying a single operation, which the plan's
	// Explain method reports.
	OpFailed
	// OpSkipped is an operation tmux never saw. tmux abandons the rest of a
	// command list once one of its commands fails, and a plan stops at a failed
	// dispatch rather than sending later ones.
	OpSkipped
)

func (OpStatus) String

func (s OpStatus) String() string

String implements fmt.Stringer.

type OptionDecodeError

type OptionDecodeError struct {
	// Record is the zero-based physical output line.
	Record int
	// Reason describes the malformed record without retaining its value.
	Reason string
}

OptionDecodeError reports a malformed recognized record without retaining its value. It matches ErrMalformedOptionOutput through errors.Is; callers can recover Record and Reason with errors.As. Record is the zero-based physical output line.

func (*OptionDecodeError) Error

func (e *OptionDecodeError) Error() string

Error implements error.

func (*OptionDecodeError) Unwrap

func (e *OptionDecodeError) Unwrap() error

Unwrap makes OptionDecodeError compatible with ErrMalformedOptionOutput.

type OptionError

type OptionError struct {
	// Subcommand is the failed tmux option or hook subcommand.
	Subcommand string
	// Name is the option or hook name, when available.
	Name string
	// Result contains the library-created error's exit code and no diagnostics.
	Result CommandResult
	// contains filtered or unexported fields
}

OptionError reports a completed high-level option or hook failure. It matches ErrOption and a specific option sentinel through errors.Is; callers can recover its fields with errors.As. Library-created errors retain only Result.ExitCode. Error never renders command output because option values and hook commands may be secret; callers may construct exported values with other contents.

func (*OptionError) Error

func (e *OptionError) Error() string

Error implements error.

func (*OptionError) Unwrap

func (e *OptionError) Unwrap() error

Unwrap makes OptionError compatible with ErrOption and its specific kinds.

type OptionOrigin

type OptionOrigin uint8

OptionOrigin identifies where a present option value was resolved. The declared values form the complete set of valid origins.

const (
	// OptionOriginLocal identifies a value set directly at the queried scope.
	OptionOriginLocal OptionOrigin = iota + 1
	// OptionOriginInherited identifies a value inherited from a parent scope.
	OptionOriginInherited
)

func (OptionOrigin) String

func (o OptionOrigin) String() string

String returns the origin's tmux vocabulary, so an origin prints as a word beside the generated option values, which all carry String.

type OptionValue

type OptionValue[T any] struct {
	// contains filtered or unexported fields
}

OptionValue preserves option presence and resolution origin. Its zero value is absent. Copies of reference-bearing T values are shallow.

func (OptionValue[T]) Get

func (v OptionValue[T]) Get() (T, bool)

Get returns the option value and reports whether it is present.

func (OptionValue[T]) Origin

func (v OptionValue[T]) Origin() (OptionOrigin, bool)

Origin returns the resolution origin and reports whether the option is present.

type OptionValueError

type OptionValueError struct {
	// Name is the safe, generated tmux option name.
	Name string
}

OptionValueError reports a rejected typed option value without retaining or rendering that value. It matches ErrInvalidOptionValue and ErrOption.

func (*OptionValueError) Error

func (e *OptionValueError) Error() string

Error implements error without disclosing the attempted value.

func (*OptionValueError) Unwrap

func (e *OptionValueError) Unwrap() error

Unwrap makes OptionValueError compatible with ErrInvalidOptionValue.

type Pane

type Pane struct {
	// contains filtered or unexported fields
}

Pane is one materialized pane record within a specific winlink. It is normally returned by Server.Snapshot, Server.Pane, or Pane.Refresh. A zero Pane is not a usable tmux target.

func PaneFromEnv

func PaneFromEnv(ctx context.Context, environment map[string]string) (Pane, error)

PaneFromEnv returns the pane identified by TMUX and TMUX_PANE. Nil reads the process environment; a nonnil empty map does not. It resolves the live hierarchy later through identity-checked tmux queries.

func (Pane) Active

func (p Pane) Active() (bool, bool)

Active returns a typed bool value and an ok result parsed from tmux #{pane_active} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AlternateOn

func (p Pane) AlternateOn() (bool, bool)

AlternateOn returns a typed bool value and an ok result parsed from tmux #{alternate_on} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AlternateSavedX

func (p Pane) AlternateSavedX() (int, bool)

AlternateSavedX returns a typed int value and an ok result parsed from tmux #{alternate_saved_x} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AlternateSavedY

func (p Pane) AlternateSavedY() (int, bool)

AlternateSavedY returns a typed int value and an ok result parsed from tmux #{alternate_saved_y} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AppendHook

func (p Pane) AppendHook(ctx context.Context, name string, command string) error

AppendHook appends a pane hook at this exact pane target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the append.

func (Pane) AppendOption

func (p Pane) AppendOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

AppendOption appends to a pane option at this exact pane target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.

func (Pane) AtBottom

func (p Pane) AtBottom() (bool, bool)

AtBottom returns a typed bool value and an ok result parsed from tmux #{pane_at_bottom} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AtLeft

func (p Pane) AtLeft() (bool, bool)

AtLeft returns a typed bool value and an ok result parsed from tmux #{pane_at_left} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AtRight

func (p Pane) AtRight() (bool, bool)

AtRight returns a typed bool value and an ok result parsed from tmux #{pane_at_right} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) AtTop

func (p Pane) AtTop() (bool, bool)

AtTop returns a typed bool value and an ok result parsed from tmux #{pane_at_top} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) BG

func (p Pane) BG() (string, bool)

BG returns a typed string value and an ok result parsed from tmux #{pane_bg} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Bottom

func (p Pane) Bottom() (int, bool)

Bottom returns a typed int value and an ok result parsed from tmux #{pane_bottom} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) BracketPasteFlag

func (p Pane) BracketPasteFlag() (bool, bool)

BracketPasteFlag returns a typed bool value and an ok result parsed from tmux #{bracket_paste_flag} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) BreakPane

func (p Pane) BreakPane(ctx context.Context, request BreakPaneRequest) (Window, error)

BreakPane moves the receiver into a new window in its exact session. Attach lets that new winlink become current in the session; it is not a global client-focus guarantee. The returned Window is freshly materialized in the receiver SessionID rather than by canonical ID-only refresh.

Before tmux 3.6, breaking the sole pane can produce no printed identity and relink the pane while retaining its old WindowID; BreakPane recognizes that exact branch and refreshes the old identity. Only a raw version string equal to "3.7" uses the placeholder-and-rename workaround. On exactly 3.7, empty Name can leave the new window named "libtmux". A nonempty Name requires a second rename, which may fail after the window was created. Versions such as 3.7a, 3.7b and 3.7c do not take this workaround.

If tmux prints a valid WindowID before a transport error, a 3.7 rename fails, or exact refresh fails, BreakPane returns the known or predicted window identity and receiver session with an Index of -1 and the error. Other failures return a zero Window. A transport or context error can be delivery-ambiguous and no rollback is attempted. See ErrInvalidCommandOutput and CommandError.

func (Pane) Capture

func (p Pane) Capture(
	ctx context.Context,
	request CapturePaneRequest,
) ([]string, error)

Capture captures printed content from the receiver's exact linked pane. It returns a caller-owned slice. A completed nonzero exit or stderr does not become a CommandError; any stdout is returned without an error.

The result is the pane's visible screen rather than a stream, and includes a shell's echo of whatever Pane.SendKeys typed. Compare whole lines when waiting for output; see "Reading a pane back" in the package documentation.

Noncanonical positions return a CaptureRequestError before execution. A version probe may fail before capture when a gated option is requested. Transport and context failures return any caller-owned partial stdout with the error; context cancellation remains detectable with errors.Is.

Example
package main

import (
	"context"
	"fmt"
	"slices"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-capture",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	// ResolveActivePane reports absence as ok=false rather than as an error,
	// because a session can exist with no active pane.
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}
	command := "printf 'build ready\\n'"
	if err := pane.SendKeys(ctx, tmux.SendKeysRequest{Command: &command}); err != nil {
		fmt.Println("send keys:", err)
		return
	}

	// tmux accepts the keys before the shell has run them, so poll the pane
	// until the output appears or ctx expires.
	ticker := time.NewTicker(10 * time.Millisecond)
	defer ticker.Stop()
	for {
		lines, err := pane.Capture(ctx, tmux.CapturePaneRequest{})
		if err != nil {
			fmt.Println("capture:", err)
			return
		}
		if slices.Contains(lines, "build ready") {
			fmt.Println("build ready")
			return
		}
		select {
		case <-ctx.Done():
			fmt.Println("timed out waiting for output")
			return
		case <-ticker.C:
		}
	}
}
Output:
build ready

func (Pane) CaptureBytes

func (p Pane) CaptureBytes(
	ctx context.Context,
	request CapturePaneRequest,
) ([]byte, error)

CaptureBytes captures printed content from the receiver's exact linked pane as caller-owned stdout bytes. It preserves tmux's output delimiters and trailing newlines after tmux has interpreted the pane's terminal contents.

Its request, completed-exit, stderr, version, transport, and context behavior matches Pane.Capture. A transport or context error returns any captured partial stdout bytes with the error.

Example
package main

import (
	"context"
	"fmt"
	"time"
	"unicode/utf8"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-capture-bytes",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", err)
		return
	}

	// CaptureBytes returns what the pane holds without decoding it, which is
	// what a pane drawing anything but text has to be read with.
	output, err := pane.CaptureBytes(ctx, tmux.CapturePaneRequest{
		Start: tmux.CaptureBoundary,
		End:   tmux.CaptureBoundary,
	})
	if err != nil {
		fmt.Println("capture:", err)
		return
	}
	fmt.Println(utf8.Valid(output))
}
Output:
true

func (Pane) CaptureToBuffer

func (p Pane) CaptureToBuffer(
	ctx context.Context,
	buffer string,
	request CapturePaneRequest,
) error

CaptureToBuffer captures content from the receiver's exact linked pane into the nonempty named tmux buffer. The buffer is owned by tmux and no printed output is returned. A completed nonzero exit or stderr does not become a CommandError.

Invalid requests fail before execution. Transport and context errors remain detectable with errors.Is but are delivery-ambiguous: the buffer may already have changed when the local wait is canceled.

func (Pane) CaptureToFile

func (p Pane) CaptureToFile(
	ctx context.Context,
	path string,
	request CapturePaneRequest,
) ([]string, error)

CaptureToFile captures the receiver's exact linked pane through a tmux buffer and the file at path, returning the same lines Pane.Capture returns.

It exists because a printed capture cannot cross a control-mode connection, so Pane.Capture and Pane.CaptureBytes start a tmux process even on a handle that selected an Engine. Every tmux command this issues prints nothing, so all of them ride the engine and a watch loop built on it starts no process at all. That is the trade in full: on a handle with no engine this is three tmux processes where Pane.Capture is one.

It returns the lines it captured, where Pane.CaptureToBuffer returns only an error, because a tmux buffer needs a further command to read while this has already read the file. That makes it usable where Pane.Capture was.

path must name a file the tmux server can write and this process can read. tmux writes it, so a path only this process can reach fails in tmux rather than here. It is replaced on every call and left behind on return: the caller owns it, and its exact bytes are what Pane.CaptureBytes would have returned. The tmux buffer is this package's own and is deleted before returning, though a failure after the capture can leave one named for this process.

Concurrent calls sharing one path race for its contents. Give each caller its own path.

Its request validation, version gating, and context behavior match Pane.Capture. Its failures do not: a printed capture hands back whatever tmux printed before failing, while this reports a failure of any of its three commands, or of the read, as an error with no lines.

Example

ExamplePane_CaptureToFile watches a pane on a connected handle. Every tmux command it sends prints nothing, so the loop reuses the control connection instead of starting a tmux process per round the way Pane.Capture does.

package main

import (
	"context"
	"fmt"
	"os"
	"path/filepath"
	"slices"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-capture-to-file",
	})
	defer killExampleServer(server)

	// tmux writes this file, so it has to be a path the tmux server can reach.
	// A directory this process owns is one, because both run on this machine.
	directory, err := os.MkdirTemp("", "libtmux-go-capture")
	if err != nil {
		fmt.Println("create a directory for the capture:", err)
		return
	}
	defer func() { _ = os.RemoveAll(directory) }()
	path := filepath.Join(directory, "pane.txt")

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}
	client, err := server.OpenControl(ctx, session)
	if err != nil {
		fmt.Println("open control:", err)
		return
	}
	defer func() { _ = client.Close() }()
	pane = pane.WithServer(server.WithEngine(client.Engine()))

	command := "printf 'build ready\\n'"
	if err := pane.SendKeys(ctx, tmux.SendKeysRequest{Command: &command}); err != nil {
		fmt.Println("send keys:", err)
		return
	}

	// The lines are the ones Pane.Capture reports, so the whole-line comparison
	// that survives the shell's echo is unchanged.
	err = tmux.Poll(ctx, 10*time.Millisecond, func(ctx context.Context) (bool, error) {
		lines, err := pane.CaptureToFile(ctx, path, tmux.CapturePaneRequest{})
		if err != nil {
			return false, err
		}
		return slices.Contains(lines, "build ready"), nil
	})
	if err != nil {
		fmt.Println("wait for output:", err)
		return
	}
	fmt.Println("build ready")
}
Output:
build ready

func (Pane) ChooseBuffer

func (p Pane) ChooseBuffer(ctx context.Context) error

ChooseBuffer enters tmux's interactive buffer chooser using the receiver's exact linked target. It requires an attached client. Completed-command and cancellation semantics match Pane.CopyMode.

func (Pane) ChooseClient

func (p Pane) ChooseClient(ctx context.Context) error

ChooseClient enters tmux's interactive client chooser using the receiver's exact linked target. It requires an attached client. Completed-command and cancellation semantics match Pane.CopyMode.

func (Pane) ChooseTree

func (p Pane) ChooseTree(ctx context.Context, request ChooseTreeRequest) error

ChooseTree enters tmux's interactive session, window, and pane chooser using the receiver's exact linked target. It requires an attached client. Format and Filter are tmux expressions; neither is interpreted by a shell. Unsupported sort values and invalid arguments fail before execution. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors may leave the pane in tree mode and remain detectable with errors.Is.

func (Pane) Clear

func (p Pane) Clear(ctx context.Context) error

Clear sends the text "reset" and then Enter to the receiver's exact linked pane. The pane's current application interprets that input; Clear does not execute a shell directly. Completed exit status and stderr from either tmux invocation are ignored. A transport or context error may leave the text delivered without Enter and remains detectable with errors.Is.

func (Pane) ClearHistory

func (p Pane) ClearHistory(ctx context.Context, request ClearHistoryRequest) error

ClearHistory removes scrollback from the receiver's exact linked pane. ResetHyperlinks triggers a version probe before mutation. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors remain detectable with errors.Is, but accepted history changes are not rolled back.

func (Pane) ClockMode

func (p Pane) ClockMode(ctx context.Context) error

ClockMode enters clock mode using the receiver's exact linked target. A completed-command and cancellation semantics match Pane.CopyMode.

func (Pane) Cmd

func (p Pane) Cmd(ctx context.Context, args ...string) (CommandResult, error)

Cmd executes a tmux subcommand targeted to the pane's stable ID.

func (Pane) CopyMode

func (p Pane) CopyMode(ctx context.Context, request CopyModeRequest) error

CopyMode enters or cancels copy mode using the receiver's exact linked session-window-pane target. PageDown requires tmux 3.5; older versions emit a synchronous warning and omit that flag. A version-probe error stops the operation. tmux resolves the receiver and optional SourcePane before processing Cancel; a stale target can therefore fail without resetting the current mode. Once resolution succeeds, Cancel resets pane modes before tmux considers the other action fields. SourcePane validation and the PageDown version probe still happen in the library before tmux is invoked.

A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors remain detectable with errors.Is, but an accepted mode change is not rolled back.

func (Pane) CurrentCommand

func (p Pane) CurrentCommand() (string, bool)

CurrentCommand returns a typed string value and an ok result parsed from tmux #{pane_current_command} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CurrentPath

func (p Pane) CurrentPath() (string, bool)

CurrentPath returns a typed string value and an ok result parsed from tmux #{pane_current_path} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorBlinking

func (p Pane) CursorBlinking() (bool, bool)

CursorBlinking returns a typed bool value and an ok result parsed from tmux #{cursor_blinking} in this Pane's materialized pane-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorCharacter

func (p Pane) CursorCharacter() (string, bool)

CursorCharacter returns a typed string value and an ok result parsed from tmux #{cursor_character} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorColour

func (p Pane) CursorColour() (string, bool)

CursorColour returns a typed string value and an ok result parsed from tmux #{cursor_colour} in this Pane's materialized pane-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorFlag

func (p Pane) CursorFlag() (bool, bool)

CursorFlag returns a typed bool value and an ok result parsed from tmux #{cursor_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorShape

func (p Pane) CursorShape() (string, bool)

CursorShape returns a typed string value and an ok result parsed from tmux #{cursor_shape} in this Pane's materialized pane-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorVeryVisible

func (p Pane) CursorVeryVisible() (bool, bool)

CursorVeryVisible returns a typed bool value and an ok result parsed from tmux #{cursor_very_visible} in this Pane's materialized pane-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorX

func (p Pane) CursorX() (int, bool)

CursorX returns a typed int value and an ok result parsed from tmux #{cursor_x} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CursorY

func (p Pane) CursorY() (int, bool)

CursorY returns a typed int value and an ok result parsed from tmux #{cursor_y} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) CustomizeMode

func (p Pane) CustomizeMode(ctx context.Context) error

CustomizeMode enters tmux's interactive option browser using the receiver's exact linked target. It requires an attached client. Completed-command and cancellation semantics match Pane.CopyMode.

func (Pane) Dead

func (p Pane) Dead() (bool, bool)

Dead returns a typed bool value and an ok result parsed from tmux #{pane_dead} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) DeadSignal

func (p Pane) DeadSignal() (string, bool)

DeadSignal returns a typed string value and an ok result parsed from tmux #{pane_dead_signal} in this Pane's materialized pane-scoped record (tmux 3.3 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) DeadStatus

func (p Pane) DeadStatus() (int, bool)

DeadStatus returns a typed int value and an ok result parsed from tmux #{pane_dead_status} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) DeadTime

func (p Pane) DeadTime() (time.Time, bool)

DeadTime returns a typed time.Time value and an ok result parsed from tmux #{pane_dead_time} in this Pane's materialized pane-scoped record (tmux 3.3 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) DisplayMessage

func (p Pane) DisplayMessage(
	ctx context.Context,
	request PaneDisplayMessageRequest,
) ([]string, error)

DisplayMessage displays or prints a message at this pane's exact target. Embedded NoExpand requires tmux 3.4 and UpdatePane requires tmux 3.6; each otherwise synchronously reaches the caller-goroutine WarningHandler before its reduced command runs and before this call returns. Print returns an owned stdout slice even on a completed nonzero exit. Completed stderr synchronously reaches that handler as WarningCommandStderr, not an error; cancellation does not prove display or pane update did not occur.

func (Pane) DisplayPanes

func (p Pane) DisplayPanes(ctx context.Context, request DisplayPanesRequest) error

DisplayPanes displays pane numbers for tmux's current client and waits for the indicator to close. It is client-scoped: the receiver supplies only the server connection and no pane target. A zero request uses tmux's configured duration and permits number-key selection.

A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors remain detectable with errors.Is, but cancellation cannot revoke an accepted display.

func (Pane) DisplayPopup

func (p Pane) DisplayPopup(ctx context.Context, request DisplayPopupRequest) error

DisplayPopup displays an overlay on the selected client and waits until it closes after command exit or user dismissal. A zero request starts tmux's default command or default shell and may wait indefinitely. The API exposes no popup process handle, stdout, or child exit status.

The command carries the receiver's exact linked session-window-pane target, which supplies format and working-directory context. TargetClient selects the overlay client; it does not turn the operation into pane delivery. tmux interprets Command as a shell command. The library's protection for a final semicolon applies only to tmux's outer command parser and does not quote or neutralize the inner shell command.

Title, BorderLines, Style, BorderStyle, Environment, and NoBorder require tmux 3.3. CloseOnAnyKey and NoKeys require tmux 3.6. Unsupported requested fields produce synchronous warnings and are omitted.

When this call modifies an existing popup, NoKeys resets its automatic-close flags before tmux applies any close flags in this request. CloseOnAnyKey acts only after the popup job exits; while the job is active, keys go to the job.

Invalid fields fail before display. A completed invocation produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Context errors remain detectable with errors.Is, but cancellation cannot dismiss or revoke an accepted popup, which may remain visible.

func (Pane) Enter

func (p Pane) Enter(ctx context.Context) error

Enter sends the Enter key to the receiver's exact linked pane. Completed exit status and stderr are ignored. Transport and context errors remain detectable with errors.Is, but delivery may already have occurred.

func (Pane) Equal

func (p Pane) Equal(other Pane) bool

Equal reports whether two pane records carry the same stable pane ID. It intentionally collapses linked-session views; a pane's exact view identity includes SessionID, WindowID, WindowIndex, and PaneID.

func (Pane) FG

func (p Pane) FG() (string, bool)

FG returns a typed string value and an ok result parsed from tmux #{pane_fg} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) FindWindow

func (p Pane) FindWindow(ctx context.Context, request FindWindowRequest) error

FindWindow opens a tree chooser filtered by Match using the receiver's exact linked target. It requires an attached client. Match is passed as one tmux search operand and protected from leading-dash option parsing; it is not a tmux format or shell command. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors may leave the chooser open and remain detectable with errors.Is.

func (Pane) Flags

func (p Pane) Flags() (string, bool)

Flags returns a typed string value and an ok result parsed from tmux #{pane_flags} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) FloatingFlag

func (p Pane) FloatingFlag() (bool, bool)

FloatingFlag returns a typed bool value and an ok result parsed from tmux #{pane_floating_flag} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Format

func (p Pane) Format() (bool, bool)

Format returns a typed bool value and an ok result parsed from tmux #{pane_format} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Formats

func (p Pane) Formats() FormatValues

Formats returns this Pane's read-only materialized tmux format values. It does not query tmux; use Server.Snapshot to obtain a fresh record.

func (Pane) Height

func (p Pane) Height() (int, bool)

Height returns a typed int value and an ok result parsed from tmux #{pane_height} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) HistoryAllBytes

func (p Pane) HistoryAllBytes() (string, bool)

HistoryAllBytes returns a typed string value and an ok result parsed from tmux #{history_all_bytes} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) HistoryBytes

func (p Pane) HistoryBytes() (int, bool)

HistoryBytes returns a typed int value and an ok result parsed from tmux #{history_bytes} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) HistoryLimit

func (p Pane) HistoryLimit() (int, bool)

HistoryLimit returns a typed int value and an ok result parsed from tmux #{history_limit} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) HistorySize

func (p Pane) HistorySize() (int, bool)

HistorySize returns a typed int value and an ok result parsed from tmux #{history_size} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Hooks

func (p Pane) Hooks(ctx context.Context) (PaneHookValues, error)

Hooks returns a freshly decoded, caller-owned view of known hooks at this exact pane target, including inherited values. The receiver's exact linked session context controls tmux format evaluation. A read failure is returned rather than answered with zero values.

func (Pane) ID

func (p Pane) ID() PaneID

ID returns the stable tmux pane identity.

func (Pane) InMode

func (p Pane) InMode() (int, bool)

InMode returns a typed int value and an ok result parsed from tmux #{pane_in_mode} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Index

func (p Pane) Index() int

Index returns the pane's index in its exact window view. Unlike the materialized format accessors it sits beside, it returns a plain int, because a pane record always carries the index tmux placed it at.

func (Pane) InputOff

func (p Pane) InputOff() (bool, bool)

InputOff returns a typed bool value and an ok result parsed from tmux #{pane_input_off} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) InsertFlag

func (p Pane) InsertFlag() (bool, bool)

InsertFlag returns a typed bool value and an ok result parsed from tmux #{insert_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Join

func (p Pane) Join(ctx context.Context, request JoinPaneRequest) (Pane, error)

Join relocates the receiver pane into one exact destination with tmux's join-pane command. Unless Attach is set, the destination's active-pane selection remains unchanged; Attach is not a global client-focus guarantee. The returned Pane is freshly materialized in the destination SessionID and WindowID rather than by canonical ID-only refresh.

Removing the sole pane destroys the emptied source window and all of its winlinks. Affected source sessions preserve their current selection unless that window was current, in which case they select another. A session left without windows is destroyed and detaches its clients.

If exact refresh fails after the command, Join returns a partial Pane with the receiver PaneID and predicted destination context. Other failures return a zero Pane. A transport or context error can be delivery-ambiguous and no rollback is attempted. See JoinPaneRequest and ErrInvalidRequest.

func (Pane) KeyMode

func (p Pane) KeyMode() (string, bool)

KeyMode returns a typed string value and an ok result parsed from tmux #{pane_key_mode} in this Pane's materialized pane-scoped record (tmux 3.5 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) KeypadCursorFlag

func (p Pane) KeypadCursorFlag() (bool, bool)

KeypadCursorFlag returns a typed bool value and an ok result parsed from tmux #{keypad_cursor_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) KeypadFlag

func (p Pane) KeypadFlag() (bool, bool)

KeypadFlag returns a typed bool value and an ok result parsed from tmux #{keypad_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Kill

func (p Pane) Kill(ctx context.Context) error

Kill destroys the receiver pane through its exact linked-pane target. If panes remain and the receiver was active, tmux selects another active pane. If this was the last pane, tmux also destroys the window and removes all of its winlinks. Affected sessions preserve their current selection unless the destroyed window was current, in which case they select another. A session left without windows is destroyed and detaches its clients. The receiver is not refreshed. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Pane) KillOthers

func (p Pane) KillOthers(ctx context.Context) error

KillOthers destroys every other pane in the receiver's stable window and leaves the receiver as its sole active pane. It does not select the exact winlink as its session's current window or promise client focus, and it does not destroy a window or session. The receiver is not refreshed. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Pane) Last

func (p Pane) Last() (bool, bool)

Last returns a typed bool value and an ok result parsed from tmux #{pane_last} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Left

func (p Pane) Left() (int, bool)

Left returns a typed int value and an ok result parsed from tmux #{pane_left} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Marked

func (p Pane) Marked() (bool, bool)

Marked returns a typed bool value and an ok result parsed from tmux #{pane_marked} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MarkedSet

func (p Pane) MarkedSet() (bool, bool)

MarkedSet returns a typed bool value and an ok result parsed from tmux #{pane_marked_set} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Mode

func (p Pane) Mode() (string, bool)

Mode returns a typed string value and an ok result parsed from tmux #{pane_mode} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MouseAllFlag

func (p Pane) MouseAllFlag() (bool, bool)

MouseAllFlag returns a typed bool value and an ok result parsed from tmux #{mouse_all_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MouseAnyFlag

func (p Pane) MouseAnyFlag() (bool, bool)

MouseAnyFlag returns a typed bool value and an ok result parsed from tmux #{mouse_any_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MouseButtonFlag

func (p Pane) MouseButtonFlag() (bool, bool)

MouseButtonFlag returns a typed bool value and an ok result parsed from tmux #{mouse_button_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MouseSGRFlag

func (p Pane) MouseSGRFlag() (bool, bool)

MouseSGRFlag returns a typed bool value and an ok result parsed from tmux #{mouse_sgr_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MouseStandardFlag

func (p Pane) MouseStandardFlag() (bool, bool)

MouseStandardFlag returns a typed bool value and an ok result parsed from tmux #{mouse_standard_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) MouseUTF8Flag

func (p Pane) MouseUTF8Flag() (bool, bool)

MouseUTF8Flag returns a typed bool value and an ok result parsed from tmux #{mouse_utf8_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Move

func (p Pane) Move(ctx context.Context, request MovePaneRequest) (Pane, error)

Move relocates the receiver pane into one exact destination with tmux's move-pane command. Unless Attach is set, the destination's active-pane selection remains unchanged; Attach is not a global client-focus guarantee. The returned Pane is freshly materialized in the destination SessionID and WindowID rather than by canonical ID-only refresh.

Removing the sole pane destroys the emptied source window and all of its winlinks. Affected source sessions preserve their current selection unless that window was current, in which case they select another. A session left without windows is destroyed and detaches its clients.

If exact refresh fails after the command, Move returns a partial Pane with the receiver PaneID and predicted destination context. Other failures return a zero Pane. A transport or context error can be delivery-ambiguous and no rollback is attempted. See MovePaneRequest and ErrInvalidRequest.

func (Pane) NewPane

func (p Pane) NewPane(ctx context.Context, request NewPaneRequest) (Pane, error)

NewPane creates a floating pane relative to the receiver's exact linked-pane view. Attach makes the new pane active in that session and winlink; it is not a global client-focus guarantee. The returned Pane is freshly materialized in the receiver SessionID and WindowID.

A transport or context error can be delivery-ambiguous and no rollback is attempted. If tmux printed a valid PaneID before that error, or exact refresh fails after creation, NewPane returns a partial Pane containing the receiver SessionID and WindowID and the new PaneID. Other failures return a zero Pane. See NewPaneRequest and ErrVersionTooLow.

func (Pane) Options

func (p Pane) Options(ctx context.Context) (PaneOptionValues, error)

Options returns a freshly decoded, caller-owned view of known options at this exact pane target, including inherited values. The receiver's exact linked session context controls tmux format evaluation. A read failure is returned rather than answered with zero values. Each returned accessor names the setter that writes it, so PaneOptionValues.WindowStyle pairs with Pane.SetWindowStyle.

func (Pane) OriginFlag

func (p Pane) OriginFlag() (bool, bool)

OriginFlag returns a typed bool value and an ok result parsed from tmux #{origin_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) PBProgress

func (p Pane) PBProgress() (int, bool)

PBProgress returns a typed int value and an ok result parsed from tmux #{pane_pb_progress} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) PBState

func (p Pane) PBState() (string, bool)

PBState returns a typed string value and an ok result parsed from tmux #{pane_pb_state} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) PasteBuffer

func (p Pane) PasteBuffer(ctx context.Context, request PasteBufferRequest) error

PasteBuffer pastes a named or top buffer into the receiver's exact linked pane. DeleteAfter requests deletion after tmux processes an existing buffer; an exited target or missing named buffer fails before deletion, while deletion after disabled pane input does not prove byte delivery.

NoVis requires tmux 3.7. Older versions already paste raw bytes, so the flag is omitted with a synchronous unsupported-feature warning. A version-probe error stops execution. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors remain detectable with errors.Is, but accepted paste or deletion effects are not rolled back.

func (Pane) Path

func (p Pane) Path() (string, bool)

Path returns a typed string value and an ok result parsed from tmux #{pane_path} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Pipe

func (p Pane) Pipe(ctx context.Context, request PipePaneRequest) error

Pipe starts, toggles, or stops piping for the receiver's exact linked pane. tmux expands formats and time formats in Command before running it with sh -c. The library's protection for a final semicolon applies only to tmux's outer command parser; it does not quote or neutralize the child shell.

A nil Command, and an explicit empty Command under tmux semantics, stops the current pipe. Successful return means tmux installed, toggled, or stopped the pipe; it does not report child-shell success or pipe lifetime. A completed invocation produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors remain detectable with errors.Is, but an accepted pipe change is not rolled back.

func (Pane) PipePID

func (p Pane) PipePID() (int, bool)

PipePID returns a typed int value and an ok result parsed from tmux #{pane_pipe_pid} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Piping

func (p Pane) Piping() (bool, bool)

Piping returns a typed bool value and an ok result parsed from tmux #{pane_pipe} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) ProcessPID

func (p Pane) ProcessPID() (int, bool)

ProcessPID returns a typed int value and an ok result parsed from tmux #{pane_pid} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) RawHook

func (p Pane) RawHook(ctx context.Context, name string) (string, bool, error)

RawHook returns one exact pane hook value at this exact pane target. A successful string is caller-owned; the receiver's exact linked session context controls tmux format evaluation, and completed failures are returned.

func (Pane) RawOption

func (p Pane) RawOption(ctx context.Context, name string) (string, bool, error)

RawOption returns one exact pane option value at this exact pane target. A successful string is caller-owned; the receiver's exact linked session context controls tmux format evaluation, and a completed failure is returned.

func (Pane) Ref

func (p Pane) Ref() Ref

Ref returns a Ref addressing the receiver.

func (Pane) Refresh

func (p Pane) Refresh(ctx context.Context) (Pane, error)

Refresh performs a canonical live lookup for the pane's stable ID and returns a new record without mutating the receiver. It does not preserve a linked-session view; use Pane.ResolveWindow for exact relationships. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Pane) Reset

func (p Pane) Reset(ctx context.Context) error

Reset submits one tmux command list that resets terminal state and then clears history for the receiver's exact linked pane. Each subcommand carries the exact target. The two mutations are not atomic: terminal state or history may be only partially reset. Completed exit status and stderr are ignored. Transport and context errors remain detectable with errors.Is, but an accepted command list cannot be revoked.

func (Pane) Resize

func (p Pane) Resize(ctx context.Context, request ResizePaneRequest) (Pane, error)

Resize runs tmux resize-pane against the receiver's exact linked session-window-pane target, then refreshes by PaneID. The returned canonical Pane may therefore carry a different linked-session or winlink context. If the resize is accepted but refresh fails, Resize returns the original receiver with that error.

Invalid requests fail before execution. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is followed by refresh. Transport and context errors return a zero Pane and may be delivery-ambiguous. Context errors remain detectable with errors.Is, and cancellation cannot roll back an accepted resize.

func (Pane) ResolveSession

func (p Pane) ResolveSession(ctx context.Context) (Session, error)

ResolveSession snapshots live tmux state and returns the parent session of this pane's exact winlink. It returns SnapshotLookupError cardinality errors. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Pane) ResolveWindow

func (p Pane) ResolveWindow(ctx context.Context) (Window, error)

ResolveWindow snapshots live tmux state and returns the exact winlink containing this pane view. It returns SnapshotLookupError cardinality errors. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Pane) Respawn

func (p Pane) Respawn(ctx context.Context, request RespawnRequest) (Pane, error)

Respawn restarts the process in the receiver's exact linked pane on tmux 3.2a or newer. Command, when present, is passed as one tmux shell-command operand; Go neither executes it locally nor adds inner-shell quoting. Final semicolon protection applies only to tmux's outer command parser. See RespawnRequest for zero-value, directory, environment, and Kill behavior.

Respawn refreshes by PaneID, so the returned canonical Pane may carry a different linked-session or winlink context. The process may be restarted before refresh fails; in that case Respawn returns the original receiver and the refresh error. Validation, transport, context, or completed-stderr failures return a zero Pane. Completed stderr produces a CommandError that retains only the exit code, while a nonzero exit without stderr is followed by refresh. Context errors remain detectable with errors.Is but cannot revoke a respawn already accepted by tmux.

func (Pane) Right

func (p Pane) Right() (int, bool)

Right returns a typed int value and an ok result parsed from tmux #{pane_right} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) RunHook

func (p Pane) RunHook(ctx context.Context, name string) error

RunHook asks tmux to run one pane hook directly at this exact target. The receiver's exact linked session context controls tmux format evaluation; no racy preflight is issued. Completed failures are secret-safe option errors; cancellation does not prove execution did not occur.

func (Pane) ScrollRegionLower

func (p Pane) ScrollRegionLower() (int, bool)

ScrollRegionLower returns a typed int value and an ok result parsed from tmux #{scroll_region_lower} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) ScrollRegionUpper

func (p Pane) ScrollRegionUpper() (int, bool)

ScrollRegionUpper returns a typed int value and an ok result parsed from tmux #{scroll_region_upper} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) SearchString

func (p Pane) SearchString() (string, bool)

SearchString returns a typed string value and an ok result parsed from tmux #{pane_search_string} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Select

func (p Pane) Select(ctx context.Context, request PaneSelectRequest) (Pane, error)

Select applies select-pane to the receiver's exact linked-pane view. Direction makes an adjacent pane active, but the returned Pane is a fresh exact refresh of the receiver rather than the newly active pane. With no Direction, Mark, or Input, the receiver becomes active. Mark changes the server-wide marked pane without selection; Input changes the receiver's input state without selection. None of these modes selects the window in its session or promises client focus.

If the command succeeds but exact refresh fails, Select returns the receiver with that error; other command failures return a zero Pane. A transport or context error can be delivery-ambiguous and no rollback is attempted.

func (Pane) SendKeys

func (p Pane) SendKeys(ctx context.Context, request SendKeysRequest) error

SendKeys invokes tmux send-keys with the receiver's exact linked session-window-pane target. This is tmux key input, not shell execution: Literal only changes tmux key parsing, and any delivered text may still be interpreted by the application running in the pane. In KeyName mode, tmux instead routes the keys through the selected client's key table; the pane target does not imply pane delivery.

KeyName and TargetClient require tmux 3.4. On older versions SendKeys emits synchronous unsupported-feature warnings and omits the corresponding flags. A version-probe error stops execution.

Completed exit status and stderr are ignored. Transport and context errors are returned and remain detectable with errors.Is. Delivery is ambiguous on such errors, including between the Command and separate Enter invocations, and cancellation cannot revoke keys already accepted by tmux.

Example
package main

import (
	"context"
	"fmt"
	"slices"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-send-keys",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", err)
		return
	}

	command := "printf 'build ready\\n'"
	if err := pane.SendKeys(ctx, tmux.SendKeysRequest{
		Command: &command,
		Literal: true,
	}); err != nil {
		fmt.Println("send keys:", err)
		return
	}

	// Keys reach a shell, which runs them when it gets to them, so the pane is
	// read until the output appears rather than once afterwards.
	ticker := time.NewTicker(10 * time.Millisecond)
	defer ticker.Stop()
	for {
		lines, err := pane.Capture(ctx, tmux.CapturePaneRequest{
			Start: tmux.CaptureBoundary,
			End:   tmux.CaptureBoundary,
		})
		if err != nil {
			fmt.Println("capture:", err)
			return
		}
		if slices.Contains(lines, "build ready") {
			break
		}
		select {
		case <-ctx.Done():
			fmt.Println("the pane never showed it")
			return
		case <-ticker.C:
		}
	}

	fmt.Println("the pane echoed the command's output")
}
Output:
the pane echoed the command's output

func (Pane) SendPrefix

func (p Pane) SendPrefix(ctx context.Context, key PrefixKey) error

SendPrefix sends a tmux prefix key to the receiver's exact linked pane. Unsupported PrefixKey values fail before execution. A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is ignored. Transport and context errors remain detectable with errors.Is, but delivery may already have occurred.

func (Pane) Server

func (p Pane) Server() Server

Server returns the configured handle that produced the pane.

func (Pane) Session

func (p Pane) Session() (Session, bool)

Session returns this view's parent record when it remains in the same snapshot. It never queries tmux.

func (Pane) SessionID

func (p Pane) SessionID() SessionID

SessionID returns the linked session containing this pane view.

func (Pane) SetAllowPassthrough

func (p Pane) SetAllowPassthrough(ctx context.Context, value AllowPassthrough) error

SetAllowPassthrough stores the "allow-passthrough" pane option, available since tmux 3.3. It accepts AllowPassthrough and does not expose raw set-option flags. Read it back with PaneOptionValues.AllowPassthrough from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetAllowRename

func (p Pane) SetAllowRename(ctx context.Context, value bool) error

SetAllowRename stores the "allow-rename" pane option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with PaneOptionValues.AllowRename from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetAllowSetTitle

func (p Pane) SetAllowSetTitle(ctx context.Context, value bool) error

SetAllowSetTitle stores the "allow-set-title" pane option, available since tmux 3.5. It accepts bool and does not expose raw set-option flags. Read it back with PaneOptionValues.AllowSetTitle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetAlternateScreen

func (p Pane) SetAlternateScreen(ctx context.Context, value bool) error

SetAlternateScreen stores the "alternate-screen" pane option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with PaneOptionValues.AlternateScreen from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetCopyModePositionFormat

func (p Pane) SetCopyModePositionFormat(ctx context.Context, value string) error

SetCopyModePositionFormat stores the "copy-mode-position-format" pane option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.CopyModePositionFormat from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetCursorColour

func (p Pane) SetCursorColour(ctx context.Context, value string) error

SetCursorColour stores the "cursor-colour" pane option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.CursorColour from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetCursorStyle

func (p Pane) SetCursorStyle(ctx context.Context, value CursorStyle) error

SetCursorStyle stores the "cursor-style" pane option, available since tmux 3.3. It accepts CursorStyle and does not expose raw set-option flags. Read it back with PaneOptionValues.CursorStyle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetHeight

func (p Pane) SetHeight(ctx context.Context, height int) (Pane, error)

SetHeight resizes the pane to a nonnegative absolute height in cells. Zero is an explicit height. Targeting, refresh, and error semantics match Pane.Resize.

func (Pane) SetHook

func (p Pane) SetHook(ctx context.Context, name string, command string) error

SetHook stores a pane hook at this exact pane target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (Pane) SetHooks

func (p Pane) SetHooks(
	ctx context.Context,
	name string,
	values SparseArray[string],
	options SetHooksOptions,
) (SetHooksResult, error)

SetHooks applies indexed pane hook commands in ascending order at this handle's exact pane target. With ClearExisting it confirms clearing first, stops at the first failure without rollback, and reports confirmed progress. Cancellation may follow accepted commands and cannot disprove their delivery.

func (Pane) SetOption

func (p Pane) SetOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

SetOption stores a pane option at this exact pane target without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (Pane) SetPaneActiveBorderStyle

func (p Pane) SetPaneActiveBorderStyle(ctx context.Context, value string) error

SetPaneActiveBorderStyle stores the "pane-active-border-style" pane option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.PaneActiveBorderStyle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetPaneBorderFormat

func (p Pane) SetPaneBorderFormat(ctx context.Context, value string) error

SetPaneBorderFormat stores the "pane-border-format" pane option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.PaneBorderFormat from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetPaneBorderStyle

func (p Pane) SetPaneBorderStyle(ctx context.Context, value string) error

SetPaneBorderStyle stores the "pane-border-style" pane option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.PaneBorderStyle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetPaneColours

func (p Pane) SetPaneColours(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetPaneColours performs a complete replacement of the "pane-colours" pane option, available since tmux 3.3. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with PaneOptionValues.PaneColours from Pane.Options. Use Pane.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Pane.UnsetOption to restore inheritance or the global default.

func (Pane) SetPaneScrollbarsStyle

func (p Pane) SetPaneScrollbarsStyle(ctx context.Context, value string) error

SetPaneScrollbarsStyle stores the "pane-scrollbars-style" pane option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.PaneScrollbarsStyle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetRemainOnExit

func (p Pane) SetRemainOnExit(ctx context.Context, value RemainOnExit) error

SetRemainOnExit stores the "remain-on-exit" pane option, available since tmux 3.2a. It accepts RemainOnExit and does not expose raw set-option flags. Read it back with PaneOptionValues.RemainOnExit from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetRemainOnExitFormat

func (p Pane) SetRemainOnExitFormat(ctx context.Context, value string) error

SetRemainOnExitFormat stores the "remain-on-exit-format" pane option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.RemainOnExitFormat from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetScrollOnClear

func (p Pane) SetScrollOnClear(ctx context.Context, value bool) error

SetScrollOnClear stores the "scroll-on-clear" pane option, available since tmux 3.3. It accepts bool and does not expose raw set-option flags. Read it back with PaneOptionValues.ScrollOnClear from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetSynchronizePanes

func (p Pane) SetSynchronizePanes(ctx context.Context, value bool) error

SetSynchronizePanes stores the "synchronize-panes" pane option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with PaneOptionValues.SynchronizePanes from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetTitle

func (p Pane) SetTitle(ctx context.Context, title string) (Pane, error)

SetTitle sets the title of the receiver's exact linked pane. tmux expands format expressions in title; the value is not a shell command. SetTitle then refreshes by PaneID, so the returned canonical Pane may carry a different linked-session or winlink context. If the mutation is accepted but refresh fails, SetTitle returns the original receiver with that error.

A completed command produces a CommandError only when tmux writes stderr; the library-created error retains only the exit code. A nonzero exit without stderr is followed by refresh. Transport and context errors return a zero Pane and may be delivery-ambiguous. Context errors remain detectable with errors.Is, and cancellation cannot roll back an accepted title change.

func (Pane) SetTreeModePreviewFormat

func (p Pane) SetTreeModePreviewFormat(ctx context.Context, value string) error

SetTreeModePreviewFormat stores the "tree-mode-preview-format" pane option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.TreeModePreviewFormat from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetWidth

func (p Pane) SetWidth(ctx context.Context, width int) (Pane, error)

SetWidth resizes the pane to a nonnegative absolute width in cells. Zero is an explicit width. Targeting, refresh, and error semantics match Pane.Resize.

func (Pane) SetWindowActiveStyle

func (p Pane) SetWindowActiveStyle(ctx context.Context, value string) error

SetWindowActiveStyle stores the "window-active-style" pane option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.WindowActiveStyle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) SetWindowStyle

func (p Pane) SetWindowStyle(ctx context.Context, value string) error

SetWindowStyle stores the "window-style" pane option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with PaneOptionValues.WindowStyle from Pane.Options, and Pane.UnsetOption restores inheritance or the global default. Use Pane.SetOption for caller-named options or raw values.

func (Pane) Split

func (p Pane) Split(ctx context.Context, request SplitPaneRequest) (Pane, error)

Split creates a tiled pane relative to the receiver's exact linked-pane view. Attach makes the new pane active in that session and winlink; it is not a global client-focus guarantee. The returned Pane is freshly materialized in the receiver SessionID and WindowID.

A transport or context error can be delivery-ambiguous and no rollback is attempted. If tmux printed a valid PaneID before that error, or exact refresh fails after creation, Split returns a partial Pane containing the receiver SessionID and WindowID and the new PaneID. Other failures return a zero Pane. See SplitPaneRequest, WarningHandler, and ErrInvalidCommandOutput.

func (Pane) StartCommand

func (p Pane) StartCommand() (string, bool)

StartCommand returns a typed string value and an ok result parsed from tmux #{pane_start_command} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) StartPath

func (p Pane) StartPath() (string, bool)

StartPath returns a typed string value and an ok result parsed from tmux #{pane_start_path} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) String

func (p Pane) String() string

String returns the pane identity and its materialized parent, when present.

func (Pane) Swap

func (p Pane) Swap(ctx context.Context, request SwapPaneRequest) (PaneSwapResult, error)

Swap exchanges the receiver with one exact or adjacent pane. Explicit targets use exact linked-pane views; PaneID alone does not distinguish linked views. Unless Detach is set, tmux may change active-pane selection; this is not a global client-focus guarantee. A directional swap cannot identify the adjacent target because tmux does not report it, so the returned PaneSwapResult.Target is zero.

An explicit swap returns freshly materialized exact views for both original PaneIDs. If exact refresh fails after the command, Swap returns a predicted result carrying every identity it can know with the error. Other failures return a zero result. A transport or context error can be delivery-ambiguous and no rollback is attempted. See SwapPaneRequest and ErrInvalidRequest.

func (Pane) Synchronized

func (p Pane) Synchronized() (bool, bool)

Synchronized returns a typed bool value and an ok result parsed from tmux #{pane_synchronized} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) SynchronizedOutputFlag

func (p Pane) SynchronizedOutputFlag() (bool, bool)

SynchronizedOutputFlag returns a typed bool value and an ok result parsed from tmux #{synchronized_output_flag} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) TTY

func (p Pane) TTY() (string, bool)

TTY returns a typed string value and an ok result parsed from tmux #{pane_tty} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Tabs

func (p Pane) Tabs() (string, bool)

Tabs returns a typed string value and an ok result parsed from tmux #{pane_tabs} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Title

func (p Pane) Title() (string, bool)

Title returns a typed string value and an ok result parsed from tmux #{pane_title} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Top

func (p Pane) Top() (int, bool)

Top returns a typed int value and an ok result parsed from tmux #{pane_top} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) UnseenChanges

func (p Pane) UnseenChanges() (bool, bool)

UnseenChanges returns a typed bool value and an ok result parsed from tmux #{pane_unseen_changes} in this Pane's materialized pane-scoped record (tmux 3.4 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) UnsetHook

func (p Pane) UnsetHook(ctx context.Context, name string) error

UnsetHook removes every matching pane hook index at this exact pane target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the unset was accepted.

func (Pane) UnsetOption

func (p Pane) UnsetOption(
	ctx context.Context,
	name string,
	options UnsetOptionOptions,
) error

UnsetOption unsets a pane option at this exact pane target without refreshing models. UnsetPanes is invalid at this scope; cancellation does not prove the unset was not accepted.

func (Pane) Width

func (p Pane) Width() (int, bool)

Width returns a typed int value and an ok result parsed from tmux #{pane_width} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Window

func (p Pane) Window() (Window, bool)

Window returns this pane's exact winlink record when it remains in the same snapshot. It never queries tmux.

func (Pane) WindowID

func (p Pane) WindowID() WindowID

WindowID returns the underlying stable tmux window identity.

func (Pane) WindowIndex

func (p Pane) WindowIndex() int

WindowIndex returns this pane view's window index in its linked session.

func (Pane) WithServer

func (p Pane) WithServer(server Server) Pane

WithServer returns a copy of the pane whose operations run through server. It is the write half of Pane.Server and queries tmux for nothing: a record holds its handle as a plain field, so moving one onto a handle that selected an Engine with Server.WithEngine costs a struct copy rather than a second lookup.

It exists because a record keeps the handle that produced it. One obtained before an engine was selected keeps starting a tmux process for every command and reports no error while doing so, which is the failure this turns into a one-line fix.

Nothing checks that server addresses the same tmux server, because nothing here talks to tmux. A record moved onto a handle with another socket resolves against whatever answers there and reports a missing target at its next command rather than at this call.

Pane.Session and Pane.Window carry the handle of the record they are read from, so one move covers the relations reached through it. Pane.Capture and Pane.CaptureBytes still start a process on any handle, because they promise tmux's own stdout bytes; Pane.CaptureToFile is the pane read that stays on the engine.

Example

ExamplePane_WithServer counts what a record costs before and after it is moved onto a connected handle. The counter is there because the failure it prevents is silent: a record made before the engine existed keeps starting a tmux process for every command and reports nothing wrong while doing so.

package main

import (
	"context"
	"fmt"
	"sync"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
	defer cancel()

	var mutex sync.Mutex
	var processes int
	counting := tmux.CommandRunnerFunc(func(
		ctx context.Context,
		request tmux.CommandRequest,
	) (tmux.CommandResult, error) {
		mutex.Lock()
		processes++
		mutex.Unlock()
		return tmux.SubprocessRunner().Run(ctx, request)
	})
	count := func() int {
		mutex.Lock()
		defer mutex.Unlock()
		return processes
	}

	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-with-server",
		Runner:     counting,
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}
	// tmux -V is a client-global option rather than a command, so no engine can
	// carry it. Reading it once now keeps that one process out of the counts.
	if _, err := server.Version(ctx); err != nil {
		fmt.Println("read version:", err)
		return
	}
	client, err := server.OpenControl(ctx, session)
	if err != nil {
		fmt.Println("open control:", err)
		return
	}
	defer func() { _ = client.Close() }()
	connected := server.WithEngine(client.Engine())

	before := count()
	if _, err := pane.Refresh(ctx); err != nil {
		fmt.Println("refresh the held record:", err)
		return
	}
	fmt.Println("processes for the record made before the engine:", count() > before)

	// The move is a value operation: the pane's handle is configuration, so
	// nothing is looked up again and no command is sent.
	pane = pane.WithServer(connected)

	before = count()
	if _, err := pane.Refresh(ctx); err != nil {
		fmt.Println("refresh the moved record:", err)
		return
	}
	fmt.Println("processes for the same record after the move:", count()-before)
}
Output:
processes for the record made before the engine: true
processes for the same record after the move: 0

func (Pane) WrapFlag

func (p Pane) WrapFlag() (bool, bool)

WrapFlag returns a typed bool value and an ok result parsed from tmux #{wrap_flag} in this Pane's materialized pane-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) X

func (p Pane) X() (int, bool)

X returns a typed int value and an ok result parsed from tmux #{pane_x} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Y

func (p Pane) Y() (int, bool)

Y returns a typed int value and an ok result parsed from tmux #{pane_y} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) Z

func (p Pane) Z() (int, bool)

Z returns a typed int value and an ok result parsed from tmux #{pane_z} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Pane) ZoomedFlag

func (p Pane) ZoomedFlag() (bool, bool)

ZoomedFlag returns a typed bool value and an ok result parsed from tmux #{pane_zoomed_flag} in this Pane's materialized pane-scoped record (tmux 3.7 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Pane.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

type PaneBorderIndicators

type PaneBorderIndicators string

PaneBorderIndicators is a typed value for the "pane-border-indicators" tmux option. Its zero value is invalid.

const (
	// PaneBorderIndicatorsOff selects "off".
	PaneBorderIndicatorsOff PaneBorderIndicators = "off"
	// PaneBorderIndicatorsColour selects "colour".
	PaneBorderIndicatorsColour PaneBorderIndicators = "colour"
	// PaneBorderIndicatorsArrows selects "arrows".
	PaneBorderIndicatorsArrows PaneBorderIndicators = "arrows"
	// PaneBorderIndicatorsBoth selects "both".
	PaneBorderIndicatorsBoth PaneBorderIndicators = "both"
)

func (PaneBorderIndicators) String

func (v PaneBorderIndicators) String() string

String returns the exact tmux spelling of v.

func (PaneBorderIndicators) Valid

func (v PaneBorderIndicators) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PaneBorderLines

type PaneBorderLines string

PaneBorderLines is a typed value for the "pane-border-lines" tmux option. Its zero value is invalid.

const (
	// PaneBorderLinesSingle selects "single".
	PaneBorderLinesSingle PaneBorderLines = "single"
	// PaneBorderLinesDouble selects "double".
	PaneBorderLinesDouble PaneBorderLines = "double"
	// PaneBorderLinesHeavy selects "heavy".
	PaneBorderLinesHeavy PaneBorderLines = "heavy"
	// PaneBorderLinesSimple selects "simple".
	PaneBorderLinesSimple PaneBorderLines = "simple"
	// PaneBorderLinesNumber selects "number".
	PaneBorderLinesNumber PaneBorderLines = "number"
	// PaneBorderLinesSpaces selects "spaces".
	PaneBorderLinesSpaces PaneBorderLines = "spaces"
)

func (PaneBorderLines) String

func (v PaneBorderLines) String() string

String returns the exact tmux spelling of v.

func (PaneBorderLines) Valid

func (v PaneBorderLines) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PaneBorderStatus

type PaneBorderStatus string

PaneBorderStatus is a typed value for the "pane-border-status" tmux option. Its zero value is invalid.

const (
	// PaneBorderStatusOff selects "off".
	PaneBorderStatusOff PaneBorderStatus = "off"
	// PaneBorderStatusTop selects "top".
	PaneBorderStatusTop PaneBorderStatus = "top"
	// PaneBorderStatusBottom selects "bottom".
	PaneBorderStatusBottom PaneBorderStatus = "bottom"
)

func (PaneBorderStatus) String

func (v PaneBorderStatus) String() string

String returns the exact tmux spelling of v.

func (PaneBorderStatus) Valid

func (v PaneBorderStatus) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PaneDirection

type PaneDirection uint8

PaneDirection selects where a tiled pane is created or moved on tmux 3.2a or later. Its zero value places the pane below the target.

const (
	// PaneDirectionBelow places the pane below the target.
	PaneDirectionBelow PaneDirection = iota
	// PaneDirectionAbove places the pane above the target.
	PaneDirectionAbove
	// PaneDirectionRight places the pane to the right of the target.
	PaneDirectionRight
	// PaneDirectionLeft places the pane to the left of the target.
	PaneDirectionLeft
)

Supported pane directions.

type PaneDisplayMessageRequest

type PaneDisplayMessageRequest struct {
	// DisplayMessageRequest supplies the shared display options.
	DisplayMessageRequest
	// UpdatePane updates pane state; tmux before 3.6 refuses it; see UnsupportedPolicy.
	UpdatePane bool
}

PaneDisplayMessageRequest adds the pane-only update behavior to the common display-message options.

type PaneFilter

type PaneFilter struct {
	// SessionID exactly matches the stable tmux session identifier from Pane.SessionID, including its $ sigil. A nil pointer leaves SessionID unset; a non-nil pointer applies it, including when it points to the zero value.
	SessionID *SessionID `json:"sessionId,omitempty"`
	// SessionIDIn lists accepted values for the stable tmux session identifier from Pane.SessionID, including its $ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves SessionIDIn unset; a non-nil empty slice is invalid.
	SessionIDIn []SessionID `json:"sessionIdIn,omitempty"`
	// WindowID exactly matches the stable tmux window identifier from Pane.WindowID, including its @ sigil. A nil pointer leaves WindowID unset; a non-nil pointer applies it, including when it points to the zero value.
	WindowID *WindowID `json:"windowId,omitempty"`
	// WindowIDIn lists accepted values for the stable tmux window identifier from Pane.WindowID, including its @ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves WindowIDIn unset; a non-nil empty slice is invalid.
	WindowIDIn []WindowID `json:"windowIdIn,omitempty"`
	// ID exactly matches the stable tmux pane identifier from Pane.ID, including its % sigil. A nil pointer leaves ID unset; a non-nil pointer applies it, including when it points to the zero value.
	ID *PaneID `json:"id,omitempty"`
	// IDIn lists accepted values for the stable tmux pane identifier from Pane.ID, including its % sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves IDIn unset; a non-nil empty slice is invalid.
	IDIn []PaneID `json:"idIn,omitempty"`
	// WindowIndex exactly matches the nonnegative winlink index from Pane.WindowIndex. A nil pointer leaves WindowIndex unset; a non-nil pointer applies it, including when it points to the zero value.
	WindowIndex *int `json:"windowIndex,omitempty"`
	// WindowIndexIn lists accepted values for the nonnegative winlink index from Pane.WindowIndex. A candidate matches when its materialized value equals one listed value. A nil slice leaves WindowIndexIn unset; a non-nil empty slice is invalid.
	WindowIndexIn []int `json:"windowIndexIn,omitempty"`
	// WindowIndexGT requires the nonnegative winlink index from Pane.WindowIndex to be strictly greater than the pointed-to value. A nil pointer leaves WindowIndexGT unset; a non-nil pointer applies it, including when it points to the zero value.
	WindowIndexGT *int `json:"windowIndexGt,omitempty"`
	// WindowIndexGTE requires the nonnegative winlink index from Pane.WindowIndex to be greater than or equal to the pointed-to value. A nil pointer leaves WindowIndexGTE unset; a non-nil pointer applies it, including when it points to the zero value.
	WindowIndexGTE *int `json:"windowIndexGte,omitempty"`
	// WindowIndexLT requires the nonnegative winlink index from Pane.WindowIndex to be strictly less than the pointed-to value. A nil pointer leaves WindowIndexLT unset; a non-nil pointer applies it, including when it points to the zero value.
	WindowIndexLT *int `json:"windowIndexLt,omitempty"`
	// WindowIndexLTE requires the nonnegative winlink index from Pane.WindowIndex to be less than or equal to the pointed-to value. A nil pointer leaves WindowIndexLTE unset; a non-nil pointer applies it, including when it points to the zero value.
	WindowIndexLTE *int `json:"windowIndexLte,omitempty"`
	// Index exactly matches the nonnegative pane index from Pane.Index. A nil pointer leaves Index unset; a non-nil pointer applies it, including when it points to the zero value.
	Index *int `json:"index,omitempty"`
	// IndexIn lists accepted values for the nonnegative pane index from Pane.Index. A candidate matches when its materialized value equals one listed value. A nil slice leaves IndexIn unset; a non-nil empty slice is invalid.
	IndexIn []int `json:"indexIn,omitempty"`
	// IndexGT requires the nonnegative pane index from Pane.Index to be strictly greater than the pointed-to value. A nil pointer leaves IndexGT unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexGT *int `json:"indexGt,omitempty"`
	// IndexGTE requires the nonnegative pane index from Pane.Index to be greater than or equal to the pointed-to value. A nil pointer leaves IndexGTE unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexGTE *int `json:"indexGte,omitempty"`
	// IndexLT requires the nonnegative pane index from Pane.Index to be strictly less than the pointed-to value. A nil pointer leaves IndexLT unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexLT *int `json:"indexLt,omitempty"`
	// IndexLTE requires the nonnegative pane index from Pane.Index to be less than or equal to the pointed-to value. A nil pointer leaves IndexLTE unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexLTE *int `json:"indexLte,omitempty"`
	// Command exactly matches the materialized current command from Pane.CurrentCommand. A nil pointer leaves Command unset; a non-nil pointer applies it, including when it points to the zero value.
	Command *string `json:"command,omitempty"`
	// CommandIn lists accepted values for the materialized current command from Pane.CurrentCommand. A candidate matches when its materialized value equals one listed value. A nil slice leaves CommandIn unset; a non-nil empty slice is invalid.
	CommandIn []string `json:"commandIn,omitempty"`
	// CommandContains requires the materialized current command from Pane.CurrentCommand to contain the pointed-to substring. A nil pointer leaves CommandContains unset; a non-nil pointer applies it, and an empty string matches every available string.
	CommandContains *string `json:"commandContains,omitempty"`
	// CommandRegex requires the materialized current command from Pane.CurrentCommand to match Go regular expression syntax. An empty string leaves CommandRegex unset.
	CommandRegex string `json:"commandRegex,omitempty"`
	// Active exactly matches the materialized active state from Pane.Active. A nil pointer leaves Active unset; a non-nil pointer applies it, including when it points to the zero value.
	Active *bool `json:"active,omitempty"`
	// Title exactly matches the materialized title from Pane.Title. A nil pointer leaves Title unset; a non-nil pointer applies it, including when it points to the zero value.
	Title *string `json:"title,omitempty"`
	// TitleIn lists accepted values for the materialized title from Pane.Title. A candidate matches when its materialized value equals one listed value. A nil slice leaves TitleIn unset; a non-nil empty slice is invalid.
	TitleIn []string `json:"titleIn,omitempty"`
	// TitleContains requires the materialized title from Pane.Title to contain the pointed-to substring. A nil pointer leaves TitleContains unset; a non-nil pointer applies it, and an empty string matches every available string.
	TitleContains *string `json:"titleContains,omitempty"`
	// TitleRegex requires the materialized title from Pane.Title to match Go regular expression syntax. An empty string leaves TitleRegex unset.
	TitleRegex string `json:"titleRegex,omitempty"`
	// AnyOf additionally requires at least one branch to match after ordinary criteria match. A nil slice leaves AnyOf unset; a non-nil empty slice is invalid.
	AnyOf []PaneFilter `json:"anyOf,omitempty"`
	// Not excludes a candidate when its nested filter matches. A nil pointer leaves Not unset.
	Not *PaneFilter `json:"not,omitempty"`
	// Session traverses the materialized parent returned by Pane.Session. A nil pointer leaves the relation criterion unset.
	Session *SessionFilter `json:"session,omitempty"`
	// Window traverses the materialized parent returned by Pane.Window. A nil pointer leaves the relation criterion unset.
	Window *WindowFilter `json:"window,omitempty"`
}

PaneFilter evaluates already-materialized Pane values and never runs tmux. Its zero value matches every non-nil candidate. Ordinary field and relation criteria are ANDed. AnyOf additionally requires at least one branch to match; Not excludes a match. Field and relation criteria correspond to Pane.SessionID, Pane.WindowID, Pane.ID, Pane.WindowIndex, Pane.Index, Pane.CurrentCommand, Pane.Active, Pane.Title, Pane.Session, and Pane.Window. PaneFilter.Predicate, PaneFilter.MarshalJSON, and PaneFilter.UnmarshalJSON validate automatically. Use PaneFilter.Validate to check a filter constructed directly.

func PaneActiveIs

func PaneActiveIs(value bool) PaneFilter

PaneActiveIs returns a PaneFilter that exactly matches the materialized active state from Pane.Active. It sets no other criteria and does not validate value.

func PaneCommandIs

func PaneCommandIs(value string) PaneFilter

PaneCommandIs returns a PaneFilter that exactly matches the materialized current command from Pane.CurrentCommand. It sets no other criteria and does not validate value.

Example
package main

import (
	"fmt"

	"github.com/libtmux/libtmux-go/tmux"
)

func main() {
	filter := tmux.PaneCommandIs("nvim")
	fmt.Println(*filter.Command)

}
Output:
nvim

func PaneIDIs

func PaneIDIs(value PaneID) PaneFilter

PaneIDIs returns a PaneFilter that exactly matches the stable tmux pane identifier from Pane.ID, including its % sigil. It sets no other criteria and does not validate value.

func PaneIndexIs

func PaneIndexIs(value int) PaneFilter

PaneIndexIs returns a PaneFilter that exactly matches the nonnegative pane index from Pane.Index. It sets no other criteria and does not validate value.

func PaneSessionIDIs

func PaneSessionIDIs(value SessionID) PaneFilter

PaneSessionIDIs returns a PaneFilter that exactly matches the stable tmux session identifier from Pane.SessionID, including its $ sigil. It sets no other criteria and does not validate value.

func PaneTitleIs

func PaneTitleIs(value string) PaneFilter

PaneTitleIs returns a PaneFilter that exactly matches the materialized title from Pane.Title. It sets no other criteria and does not validate value.

func PaneWindowIDIs

func PaneWindowIDIs(value WindowID) PaneFilter

PaneWindowIDIs returns a PaneFilter that exactly matches the stable tmux window identifier from Pane.WindowID, including its @ sigil. It sets no other criteria and does not validate value.

func PaneWindowIndexIs

func PaneWindowIndexIs(value int) PaneFilter

PaneWindowIndexIs returns a PaneFilter that exactly matches the nonnegative winlink index from Pane.WindowIndex. It sets no other criteria and does not validate value.

func ParsePaneLookup

func ParsePaneLookup(lookup string, values ...string) (PaneFilter, error)

ParsePaneLookup converts a lookup path into a concrete pane filter. Paths traverse generated JSON relation names and separate segments with double underscores. The default operator is exact. Accepted suffixes are eq, exact, iexact, contains, icontains, startswith, istartswith, endswith, iendswith, in, nin, regex, and iregex; availability is field-specific. The eq suffix aliases exact, nin negates in, scalar operators require one value, and in and nin require one or more. Invalid paths, operators, values, or results return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (PaneFilter) MarshalJSON

func (filter PaneFilter) MarshalJSON() ([]byte, error)

MarshalJSON validates the pane filter and encodes its JSON wire object. FilterSchemaVersion remains external metadata and is not embedded in the object. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (PaneFilter) Predicate

func (filter PaneFilter) Predicate() (func(*Pane) bool, error)

Predicate validates the pane filter and returns a local predicate accepting Pane values already materialized by a Snapshot; it never runs tmux. Relation criteria traverse only relationships already materialized on that candidate. The predicate returns false for a nil candidate. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
	"github.com/libtmux/libtmux-go/tmuxq"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-pane-filter",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	window, err := session.ResolveActiveWindow(ctx)
	if err != nil {
		fmt.Println("resolve window:", err)
		return
	}
	if _, err := window.SplitPane(ctx, tmux.SplitPaneRequest{}); err != nil {
		fmt.Println("split pane:", err)
		return
	}
	panes, err := window.SearchPanes(ctx, nil)
	if err != nil {
		fmt.Println("search panes:", err)
		return
	}

	// A filter compiles to a predicate once and is then applied in Go, which is
	// what makes it usable against records already in hand.
	minimumIndex := 0
	predicate, err := (tmux.PaneFilter{IndexGT: &minimumIndex}).Predicate()
	if err != nil {
		fmt.Println("compile filter:", err)
		return
	}

	fmt.Println(len(panes), len(tmuxq.Where(panes, predicate)))
}
Output:
2 1

func (*PaneFilter) UnmarshalJSON

func (filter *PaneFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON clears the receiver, then decodes a strict pane filter JSON object. FilterSchemaVersion remains external metadata and is not embedded in the object. It rejects unknown or duplicate fields and trailing JSON, then validates decoded criteria. On error, the receiver can retain a partial or complete decoded value. All decode and framing failures and semantic validation failures return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (PaneFilter) Validate

func (filter PaneFilter) Validate() error

Validate checks structure, regular expressions, and contradictory criteria before filter use. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

type PaneHookValues

type PaneHookValues struct {
	// contains filtered or unexported fields
}

PaneHookValues is an immutable point-in-time view of known pane hook values. Its zero value has no present values. Obtain it with Pane.Hooks; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (PaneHookValues) PaneDied

PaneDied returns the "pane-died" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneHookValues) PaneExited

func (v PaneHookValues) PaneExited() OptionValue[SparseArray[string]]

PaneExited returns the "pane-exited" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneHookValues) PaneFocusIn

func (v PaneHookValues) PaneFocusIn() OptionValue[SparseArray[string]]

PaneFocusIn returns the "pane-focus-in" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneHookValues) PaneFocusOut

func (v PaneHookValues) PaneFocusOut() OptionValue[SparseArray[string]]

PaneFocusOut returns the "pane-focus-out" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneHookValues) PaneModeChanged

func (v PaneHookValues) PaneModeChanged() OptionValue[SparseArray[string]]

PaneModeChanged returns the "pane-mode-changed" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneHookValues) PaneSetClipboard

func (v PaneHookValues) PaneSetClipboard() OptionValue[SparseArray[string]]

PaneSetClipboard returns the "pane-set-clipboard" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneHookValues) PaneTitleChanged

func (v PaneHookValues) PaneTitleChanged() OptionValue[SparseArray[string]]

PaneTitleChanged returns the "pane-title-changed" pane hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Pane.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

type PaneID

type PaneID string

PaneID is tmux's stable pane identifier, including its % sigil. It does not distinguish linked-session views; the zero value is not a usable target.

func (PaneID) String

func (id PaneID) String() string

String returns the tmux identifier verbatim.

type PaneInputMode

type PaneInputMode uint8

PaneInputMode changes whether a pane accepts input on tmux 3.2a or later. Its zero value leaves input state unchanged.

const (
	// PaneInputUnchanged leaves the target pane's input state unchanged.
	PaneInputUnchanged PaneInputMode = iota
	// PaneInputDisable disables input without selecting the target pane.
	PaneInputDisable
	// PaneInputEnable enables input without selecting the target pane.
	PaneInputEnable
)

Supported pane-input changes.

type PaneMarkMode

type PaneMarkMode uint8

PaneMarkMode changes tmux's server-wide marked pane on tmux 3.2a or later. Its zero value leaves the mark unchanged.

const (
	// PaneMarkUnchanged leaves the server-wide marked pane unchanged.
	PaneMarkUnchanged PaneMarkMode = iota
	// PaneMarkSet makes the target the server-wide marked pane without selecting
	// it.
	PaneMarkSet
	// PaneMarkClear clears the server-wide marked pane without selecting the
	// target.
	PaneMarkClear
)

Supported marked-pane changes.

type PaneOptionValues

type PaneOptionValues struct {
	// contains filtered or unexported fields
}

PaneOptionValues is an immutable point-in-time view of known pane option values. Its zero value has no present values. Obtain it with Pane.Options; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (PaneOptionValues) AllowPassthrough

func (v PaneOptionValues) AllowPassthrough() OptionValue[AllowPassthrough]

AllowPassthrough returns the "allow-passthrough" pane option value as OptionValue with Go value shape OptionValue[AllowPassthrough]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.3; CHOICE since tmux 3.4 (choices: "off", "on", "all"). Set it with Pane.SetAllowPassthrough. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) AllowRename

func (v PaneOptionValues) AllowRename() OptionValue[bool]

AllowRename returns the "allow-rename" pane option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Pane.SetAllowRename. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) AllowSetTitle

func (v PaneOptionValues) AllowSetTitle() OptionValue[bool]

AllowSetTitle returns the "allow-set-title" pane option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.5. Set it with Pane.SetAllowSetTitle. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) AlternateScreen

func (v PaneOptionValues) AlternateScreen() OptionValue[bool]

AlternateScreen returns the "alternate-screen" pane option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Pane.SetAlternateScreen. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) CopyModePositionFormat

func (v PaneOptionValues) CopyModePositionFormat() OptionValue[string]

CopyModePositionFormat returns the "copy-mode-position-format" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Pane.SetCopyModePositionFormat. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) CursorColour

func (v PaneOptionValues) CursorColour() OptionValue[string]

CursorColour returns the "cursor-colour" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.3. Set it with Pane.SetCursorColour. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) CursorStyle

func (v PaneOptionValues) CursorStyle() OptionValue[CursorStyle]

CursorStyle returns the "cursor-style" pane option value as OptionValue with Go value shape OptionValue[CursorStyle]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.3 (choices: "default", "blinking-block", "block", "blinking-underline", "underline", "blinking-bar", "bar"). Set it with Pane.SetCursorStyle. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) PaneActiveBorderStyle

func (v PaneOptionValues) PaneActiveBorderStyle() OptionValue[string]

PaneActiveBorderStyle returns the "pane-active-border-style" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Pane.SetPaneActiveBorderStyle. Use Pane.RawOption for caller-named or undecoded values. It is a style option.

func (PaneOptionValues) PaneBorderFormat

func (v PaneOptionValues) PaneBorderFormat() OptionValue[string]

PaneBorderFormat returns the "pane-border-format" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.3. Set it with Pane.SetPaneBorderFormat. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) PaneBorderStyle

func (v PaneOptionValues) PaneBorderStyle() OptionValue[string]

PaneBorderStyle returns the "pane-border-style" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Pane.SetPaneBorderStyle. Use Pane.RawOption for caller-named or undecoded values. It is a style option.

func (PaneOptionValues) PaneColours

func (v PaneOptionValues) PaneColours() OptionValue[SparseArray[string]]

PaneColours returns the "pane-colours" pane option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.3. Set it with Pane.SetPaneColours. Use Pane.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (PaneOptionValues) PaneScrollbarsStyle

func (v PaneOptionValues) PaneScrollbarsStyle() OptionValue[string]

PaneScrollbarsStyle returns the "pane-scrollbars-style" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Pane.SetPaneScrollbarsStyle. Use Pane.RawOption for caller-named or undecoded values. It is a style option.

func (PaneOptionValues) RemainOnExit

func (v PaneOptionValues) RemainOnExit() OptionValue[RemainOnExit]

RemainOnExit returns the "remain-on-exit" pane option value as OptionValue with Go value shape OptionValue[RemainOnExit]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "failed"); CHOICE since tmux 3.7 (choices: "off", "on", "failed", "key"). Set it with Pane.SetRemainOnExit. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) RemainOnExitFormat

func (v PaneOptionValues) RemainOnExitFormat() OptionValue[string]

RemainOnExitFormat returns the "remain-on-exit-format" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.3. Set it with Pane.SetRemainOnExitFormat. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) ScrollOnClear

func (v PaneOptionValues) ScrollOnClear() OptionValue[bool]

ScrollOnClear returns the "scroll-on-clear" pane option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.3. Set it with Pane.SetScrollOnClear. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) SynchronizePanes

func (v PaneOptionValues) SynchronizePanes() OptionValue[bool]

SynchronizePanes returns the "synchronize-panes" pane option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Pane.SetSynchronizePanes. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) TreeModePreviewFormat

func (v PaneOptionValues) TreeModePreviewFormat() OptionValue[string]

TreeModePreviewFormat returns the "tree-mode-preview-format" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Pane.SetTreeModePreviewFormat. Use Pane.RawOption for caller-named or undecoded values. It is not a style option.

func (PaneOptionValues) WindowActiveStyle

func (v PaneOptionValues) WindowActiveStyle() OptionValue[string]

WindowActiveStyle returns the "window-active-style" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Pane.SetWindowActiveStyle. Use Pane.RawOption for caller-named or undecoded values. It is a style option.

func (PaneOptionValues) WindowStyle

func (v PaneOptionValues) WindowStyle() OptionValue[string]

WindowStyle returns the "window-style" pane option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Pane.SetWindowStyle. Use Pane.RawOption for caller-named or undecoded values. It is a style option.

type PaneRel

type PaneRel struct {
	// Some requires an existential match: at least one related value must match.
	Some *PaneFilter `json:"some,omitempty"`
	// Every requires a universal match and is vacuously true for an empty relation.
	Every *PaneFilter `json:"every,omitempty"`
	// None excludes the candidate when any related value matches.
	None *PaneFilter `json:"none,omitempty"`
}

PaneRel applies quantifiers to a materialized Pane relation. Its zero value is invalid. Some is existential, None is exclusion, and Every is universal and vacuously true for an empty relation. All enabled quantifiers are conjunctive.

func (PaneRel) MarshalJSON

func (relation PaneRel) MarshalJSON() ([]byte, error)

MarshalJSON validates and encodes the pane relation quantifiers as JSON. FilterSchemaVersion remains external metadata and is not embedded in the object. The zero relation returns ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect it.

func (*PaneRel) UnmarshalJSON

func (relation *PaneRel) UnmarshalJSON(data []byte) error

UnmarshalJSON clears the receiver, then decodes strict pane relation quantifiers. FilterSchemaVersion remains external metadata and is not embedded in the object. It rejects unknown or duplicate fields and trailing JSON, then validates decoded criteria. On error, the receiver can retain a partial or complete decoded value. All decode and framing failures and semantic validation failures return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

type PaneResizeDirection

type PaneResizeDirection uint8

PaneResizeDirection selects a directional Pane.Resize. Its zero value selects no directional adjustment.

const (
	// PaneResizeDirectionNone omits a directional resize.
	PaneResizeDirectionNone PaneResizeDirection = iota
	// PaneResizeDirectionUp selects tmux's upward adjustment.
	PaneResizeDirectionUp
	// PaneResizeDirectionDown selects tmux's downward adjustment.
	PaneResizeDirectionDown
	// PaneResizeDirectionLeft selects tmux's leftward adjustment.
	PaneResizeDirectionLeft
	// PaneResizeDirectionRight selects tmux's rightward adjustment.
	PaneResizeDirectionRight
)

type PaneScrollbars

type PaneScrollbars string

PaneScrollbars is a typed value for the "pane-scrollbars" tmux option. Its zero value is invalid.

const (
	// PaneScrollbarsOff selects "off".
	PaneScrollbarsOff PaneScrollbars = "off"
	// PaneScrollbarsModal selects "modal".
	PaneScrollbarsModal PaneScrollbars = "modal"
	// PaneScrollbarsOn selects "on".
	PaneScrollbarsOn PaneScrollbars = "on"
)

func (PaneScrollbars) String

func (v PaneScrollbars) String() string

String returns the exact tmux spelling of v.

func (PaneScrollbars) Valid

func (v PaneScrollbars) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PaneScrollbarsPosition

type PaneScrollbarsPosition string

PaneScrollbarsPosition is a typed value for the "pane-scrollbars-position" tmux option. Its zero value is invalid.

const (
	// PaneScrollbarsPositionRight selects "right".
	PaneScrollbarsPositionRight PaneScrollbarsPosition = "right"
	// PaneScrollbarsPositionLeft selects "left".
	PaneScrollbarsPositionLeft PaneScrollbarsPosition = "left"
)

func (PaneScrollbarsPosition) String

func (v PaneScrollbarsPosition) String() string

String returns the exact tmux spelling of v.

func (PaneScrollbarsPosition) Valid

func (v PaneScrollbarsPosition) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PaneSelectDirection

type PaneSelectDirection uint8

PaneSelectDirection selects a pane relative to the command target on tmux 3.2a or later. Its zero value selects no relative direction.

const (
	// PaneSelectDirectionNone selects no relative pane.
	PaneSelectDirectionNone PaneSelectDirection = iota
	// PaneSelectDirectionUp selects the pane above the target.
	PaneSelectDirectionUp
	// PaneSelectDirectionDown selects the pane below the target.
	PaneSelectDirectionDown
	// PaneSelectDirectionLeft selects the pane to the left of the target.
	PaneSelectDirectionLeft
	// PaneSelectDirectionRight selects the pane to the right of the target.
	PaneSelectDirectionRight
	// PaneSelectDirectionLast selects the previously active pane.
	PaneSelectDirectionLast
)

Supported pane-selection directions.

type PaneSelectRequest

type PaneSelectRequest struct {
	// Direction selects a pane relative to the receiver; zero selects the
	// receiver unless Mark or Input is set.
	Direction PaneSelectDirection
	// KeepZoom preserves the window's zoomed state while selecting.
	KeepZoom bool
	// Mark changes the server-wide marked pane without selecting; zero leaves it
	// unchanged.
	Mark PaneMarkMode
	// Input changes whether the receiver accepts input without selecting; zero
	// leaves input state unchanged.
	Input PaneInputMode
}

PaneSelectRequest configures select-pane for one exact receiver. Closed enums prevent conflicting direction, mark, and input flags. Its zero value selects the receiver. Mark rejects every other option. Input rejects Direction and KeepZoom because changing input does not select a pane. These combinations and enum ranges are validated before execution. The request contains no retained caller-owned storage and is supported on tmux 3.2a or later.

type PaneSize

type PaneSize struct {
	// contains filtered or unexported fields
}

PaneSize is an opaque absolute cell count or percentage for Pane.Resize. Its zero value omits the dimension. PaneCells(0) and PanePercent(0) are explicit sizes, not zero PaneSize values.

func PaneCells

func PaneCells(cells int) PaneSize

PaneCells returns an explicit pane size measured in cells. Resize validates that cells is nonnegative; zero remains an explicit request.

func PanePercent

func PanePercent(percent int) PaneSize

PanePercent returns an explicit percentage of the window size. Resize validates that percent is between 0 and 100 inclusive; zero remains an explicit request.

type PaneSwapResult

type PaneSwapResult struct {
	// Pane is the receiver's original PaneID at its post-swap exact view.
	Pane Pane
	// Target is the explicit target's original PaneID at its post-swap exact
	// view, or zero after a directional swap.
	Target Pane
}

PaneSwapResult contains original stable pane identities in their post-swap exact linked-pane views. Its zero value contains no usable endpoints. Target is zero for a directional swap because tmux does not report the adjacent pane identity. Returned models are newly materialized snapshots; the result owns its value fields and is supported on tmux 3.2a or later.

type PasteBufferRequest

type PasteBufferRequest struct {
	// BufferName selects a named tmux buffer. Nil selects the top buffer;
	// nonnil empty remains an explicit buffer name.
	BufferName *string
	// DeleteAfter asks tmux to delete an existing selected buffer after
	// processing it. Deletion does not prove bytes reached a pane whose input
	// may be disabled.
	DeleteAfter bool
	// LinefeedSeparator preserves linefeeds instead of replacing them with
	// Separator or tmux's default carriage return.
	LinefeedSeparator bool
	// Bracket surrounds the paste with bracketed-paste control codes when the
	// pane application has requested bracketed paste mode.
	Bracket bool
	// Separator replaces linefeeds. Nil uses tmux's default carriage return;
	// nonnil empty removes linefeeds. LinefeedSeparator takes precedence.
	Separator *string
	// NoVis requests raw bytes on tmux 3.7 or newer. Older versions already
	// paste raw bytes; the unsupported flag is omitted with a warning.
	NoVis bool
}

PasteBufferRequest configures one tmux paste-buffer operation. Its zero value pastes the top buffer, replaces linefeeds with tmux's default carriage-return separator, and uses the version's default control-character handling. Pointer values are read and copied before any version probe or command; the call retains none of the caller's storage. Callers must not mutate them concurrently.

type PipePaneRequest

type PipePaneRequest struct {
	// Command is a shell command for tmux's pipe process. Nil closes the current
	// pipe; nonnil empty is an explicit operand that tmux also treats as stop.
	Command *string
	// OutputOnly connects pane output to the pipe command's standard input.
	// When neither direction is set, tmux uses this direction by default.
	OutputOnly bool
	// InputOnly connects the pipe command's standard output to pane input.
	InputOnly bool
	// Toggle closes an existing pipe or opens Command when no pipe exists.
	Toggle bool
}

PipePaneRequest configures a pane pipe. OutputOnly, InputOnly, and Toggle may be combined. Command is read and copied before tmux is called; the call retains none of the caller's storage, and callers must not mutate it concurrently.

type Plan

type Plan struct {
	// contains filtered or unexported fields
}

Plan records tmux commands without running them, then runs them together.

A plan exists for two reasons. It cuts the cost of a build: commands that need no answer travel in one tmux command list rather than one tmux process each, which is most of the cost of creating a workspace. And it lets a build be written in one pass, because a step can address what an earlier step is going to create before tmux has created it.

Recording touches nothing. Plan.Preview renders what would be sent and Plan.Explain says how it would be grouped, both without a server; Plan.Run is the only method that reaches tmux.

A Plan is not safe for concurrent use. Build one from a single goroutine and run it; the commands inside it are ordered, so there is nothing to gain by sharing it.

func NewPlan

func NewPlan() *Plan

NewPlan returns an empty Plan.

func (*Plan) ClearHistory

func (p *Plan) ClearHistory(target Ref, request ClearHistoryRequest)

ClearHistory records the clearing of the scrollback of the pane target names.

It mirrors Pane.ClearHistory and takes the same request.

func (*Plan) Cmd

func (p *Plan) Cmd(target Ref, args ...string)

Cmd records raw tmux arguments targeted at the object target names, the way Session.Cmd, Window.Cmd, and Pane.Cmd send them immediately.

It is the escape hatch: a tmux command this package has no recorder for can still be part of a plan, and a Ref still names what it acts on, so it can target something an earlier step created. Pass the zero Ref for a command that names no object.

The recorded command is assumed to neither print output the caller reads nor create an object, which is what lets it share a dispatch with its neighbours. Use Plan.CmdCapture for one whose output is the point.

func (*Plan) CmdCapture

func (p *Plan) CmdCapture(target Ref, args ...string)

CmdCapture records raw tmux arguments whose output is returned in the step's OpResult, and is otherwise Plan.Cmd.

Reading output is what stops an operation sharing a dispatch, so this is sent on its own; Plan.Explain reports that.

func (*Plan) DeleteBuffer

func (p *Plan) DeleteBuffer(name string)

DeleteBuffer records a tmux buffer being removed.

It mirrors Server.DeleteBuffer. It acts on the server, so it takes no target. An empty name removes the most recently added buffer.

func (*Plan) DetachClient

func (p *Plan) DetachClient(client ClientName)

DetachClient records one client being detached.

It mirrors Server.DetachClient. It names the client rather than taking a Ref, because a client is not something a plan creates.

func (*Plan) DetachClients

func (p *Plan) DetachClients(target Ref)

DetachClients records every client attached to the session target names being detached.

It mirrors Session.DetachClients.

func (*Plan) DisplayMessage

func (p *Plan) DisplayMessage(target Ref, format string)

DisplayMessage records a format expanded against the object target names, and returns its output in the step's OpResult. The zero Ref expands it against no object, the way Plan.Cmd takes one.

It mirrors Pane.DisplayMessage. Reading output is what stops an operation sharing a dispatch: tmux merges a command list into one stdout with no boundary, so this one is sent on its own. Plan.Explain reports that.

func (*Plan) Explain

func (p *Plan) Explain() []Dispatch

Explain reports how Plan.Run would group the recorded operations into tmux commands, and why each group ends where it does. It runs no commands.

Grouping hides which operation produced what, so this is how a caller sees the shape of what will be sent: the number of dispatches is the number of times tmux is invoked.

func (*Plan) ExplainWith

func (p *Plan) ExplainWith(planner Planner) []Dispatch

ExplainWith reports how planner would group the recorded operations.

func (*Plan) JoinPane

func (p *Plan) JoinPane(target, source Ref, horizontal, detach bool)

JoinPane records the pane source names being moved beside the pane target names, splitting that pane's space.

It mirrors Pane.Join, but names both panes for the reason Plan.SwapPane does. Horizontal splits left and right rather than above and below, and Detach leaves the active-pane selection alone.

func (*Plan) KillOtherPanes

func (p *Plan) KillOtherPanes(target Ref)

KillOtherPanes records the destruction of every pane in the window holding the pane target names, except that pane.

It mirrors Pane.KillOthers.

func (*Plan) KillOtherWindows

func (p *Plan) KillOtherWindows(target Ref)

KillOtherWindows records the destruction of every window in the session holding the window target names, except that window.

It mirrors Window.KillOthers.

func (*Plan) KillPane

func (p *Plan) KillPane(target Ref)

KillPane records the destruction of the pane target names.

It mirrors Pane.Kill.

func (*Plan) KillServer

func (p *Plan) KillServer()

KillServer records the tmux server being shut down.

It mirrors Server.Kill. Nothing recorded after it can run, because there is no server left to run it.

func (*Plan) KillSession

func (p *Plan) KillSession(target Ref)

KillSession records the destruction of the session target names.

It mirrors Session.Kill.

func (*Plan) KillWindow

func (p *Plan) KillWindow(target Ref)

KillWindow records the destruction of the window target names.

It mirrors Window.Kill.

func (*Plan) LastPane

func (p *Plan) LastPane(target Ref)

LastPane records the window target names returning to its previously active pane.

It mirrors Window.LastPane.

func (*Plan) LastWindow

func (p *Plan) LastWindow(target Ref)

LastWindow records the session target names returning to its previously current window.

It mirrors Session.LastWindow.

func (*Plan) Len

func (p *Plan) Len() int

Len returns how many operations the plan has recorded.

func (*Plan) LinkWindow

func (p *Plan) LinkWindow(target, source Ref, request LinkWindowRequest)

LinkWindow records the window source names being linked into the session target names.

It mirrors Window.Link and takes the same request, except that the destination session comes from target rather than from the request's TargetSession, so a plan can link a window into a session it is about to create. TargetIndex still selects the position within it.

func (*Plan) LockServer

func (p *Plan) LockServer()

LockServer records every client attached to the server being locked.

It mirrors Server.LockServer.

func (*Plan) LockSession

func (p *Plan) LockSession(target Ref)

LockSession records every client attached to the session target names being locked.

It mirrors Session.Lock.

func (*Plan) MovePane

func (p *Plan) MovePane(target, source Ref, horizontal, detach bool)

MovePane records the pane source names being moved beside the pane target names without joining it to that pane's layout.

It mirrors Pane.Move, and names both panes for the reason Plan.SwapPane does.

func (*Plan) MoveWindow

func (p *Plan) MoveWindow(target, source Ref, request MoveWindowRequest)

MoveWindow records the window source names being moved into the session target names.

It mirrors Window.Move and takes the same request, except that the destination session comes from target rather than from the request's TargetSession. TargetIndex still selects the position within it.

func (*Plan) NewSession

func (p *Plan) NewSession(request NewSessionRequest) Ref

NewSession records a detached session and returns a Ref to it.

It mirrors Server.NewSession and takes the same request. It acts on the server rather than on an object, so it takes no target.

KillExisting is rejected: Server.NewSession probes for the named session and removes it before creating, and a plan records without reading. Record Plan.KillSession before this instead, which says the same thing in the order it happens.

func (*Plan) NewWindow

func (p *Plan) NewWindow(target Ref, request NewWindowRequest) Ref

NewWindow records a window created in the session or beside the window that target names, and returns a Ref to it.

It mirrors Session.NewWindow and Window.NewWindow and takes the same request. SelectExisting is rejected: it asks tmux for an existing window's expanded name before creating anything, and a plan records without reading.

func (*Plan) NextLayout

func (p *Plan) NextLayout(target Ref)

NextLayout records the next preset layout applied to the window target names.

It mirrors Window.NextLayout.

func (*Plan) NextWindow

func (p *Plan) NextWindow(target Ref)

NextWindow records the session target names moving to its next window.

It mirrors Session.NextWindow.

func (*Plan) Ops

func (p *Plan) Ops() []Op

Ops returns the recorded operations, in order, for a Planner to group.

func (*Plan) PipePane

func (p *Plan) PipePane(target Ref, request PipePaneRequest)

PipePane records the pane target names having its output piped to a shell command.

It mirrors Pane.Pipe and takes the same request.

func (*Plan) Preview

func (p *Plan) Preview(version Version) ([][]string, error)

Preview renders every recorded operation's argument vector without running anything, for the tmux version given.

An entry is nil when the operation names an object an earlier step has not created yet. That ID does not exist until the plan runs, and being able to write the step anyway is what a plan is for, so it is not an error.

Everything else that would stop an operation rendering is one, and is returned: arguments tmux would refuse, and the zero Ref, which addresses nothing. Catching those here is the point. A plan is not atomic, so an argument only rejected at step seven is rejected after six steps have already changed tmux; this is where that is found instead. The entries rendered before the error are returned with it.

func (*Plan) PreviousLayout

func (p *Plan) PreviousLayout(target Ref)

PreviousLayout records the previous preset layout applied to the window target names.

It mirrors Window.PreviousLayout.

func (*Plan) PreviousWindow

func (p *Plan) PreviousWindow(target Ref)

PreviousWindow records the session target names moving to its previous window.

It mirrors Session.PreviousWindow.

func (*Plan) RefreshClient

func (p *Plan) RefreshClient(client ClientName)

RefreshClient records one client being asked to redraw.

It mirrors Server.RefreshClient.

func (*Plan) RenameSession

func (p *Plan) RenameSession(target Ref, name string)

RenameSession records a new name for the session target names.

It mirrors Session.Rename.

func (*Plan) RenameWindow

func (p *Plan) RenameWindow(target Ref, name string)

RenameWindow records a new name for the window target names.

It mirrors Window.Rename.

func (*Plan) ResizePane

func (p *Plan) ResizePane(target Ref, request ResizePaneRequest)

ResizePane records a resize of the pane target names.

It mirrors Pane.Resize and takes the same request.

func (*Plan) ResizeWindow

func (p *Plan) ResizeWindow(target Ref, request ResizeWindowRequest)

ResizeWindow records a resize of the window target names.

It mirrors Window.Resize and takes the same request.

func (*Plan) RespawnPane

func (p *Plan) RespawnPane(target Ref, request RespawnRequest)

RespawnPane records the pane target names being restarted with a new command.

It mirrors Pane.Respawn and takes the same request.

func (*Plan) RespawnWindow

func (p *Plan) RespawnWindow(target Ref, request RespawnRequest)

RespawnWindow records the window target names being restarted with a new command.

It mirrors Window.Respawn and takes the same request.

func (*Plan) RotateWindow

func (p *Plan) RotateWindow(target Ref, request RotateWindowRequest)

RotateWindow records the panes of the window target names being rotated through their positions.

It mirrors Window.Rotate and takes the same request.

func (*Plan) Run

func (p *Plan) Run(ctx context.Context, server Server) (PlanResult, error)

Run sends the recorded operations to tmux through server and returns one result per operation.

Operations that need no answer travel together in one tmux command list; Plan.Explain reports that grouping ahead of time. tmux abandons a command list at its first failure, so Run stops there too: the failed operation carries the error and every operation after it is OpSkipped.

A tmux refusal is in the result rather than in a returned error, the way it is everywhere else in this package. A returned error is something else: a transport or context failure, or a PlanError for a plan that could not run as recorded, which Plan.Preview would have reported first.

Run is not atomic, because tmux has no transaction. What ran before a failure stays; the results say exactly how far it got.

func (*Plan) RunWith

func (p *Plan) RunWith(
	ctx context.Context,
	server Server,
	planner Planner,
) (PlanResult, error)

RunWith runs the plan with planner deciding how operations are grouped.

The results are the same whichever planner is used; only the number of tmux invocations changes, which is what makes two planners comparable. Passing Sequential is how a caller isolates a failure that grouping made ambiguous, since a dispatch carrying one operation attributes exactly.

func (*Plan) SelectLayout

func (p *Plan) SelectLayout(target Ref, request SelectLayoutRequest)

SelectLayout records a layout applied to the window target names.

It mirrors Window.SelectLayout and takes the same request.

func (*Plan) SelectPane

func (p *Plan) SelectPane(target Ref, request PaneSelectRequest)

SelectPane records a selection or marking of the pane target names.

It mirrors Pane.Select and takes the same request.

func (*Plan) SelectWindow

func (p *Plan) SelectWindow(target Ref)

SelectWindow records the window target names becoming its session's current window.

It mirrors Window.Select.

func (*Plan) SendKeys

func (p *Plan) SendKeys(target Ref, request SendKeysRequest)

SendKeys records keys sent to the pane target names.

It mirrors Pane.SendKeys and takes the same request. Sending keys produces no output and creates nothing, so it shares a dispatch with its neighbours; see Plan.Explain.

A request carrying a command records two steps, as Pane.SendKeys issues two tmux commands: the keys, and the Enter that submits them. Both are chainable, so they still travel together.

func (*Plan) SendPrefix

func (p *Plan) SendPrefix(target Ref, key PrefixKey)

SendPrefix records tmux's prefix key sent to the pane target names.

It mirrors Pane.SendPrefix.

func (*Plan) SetBuffer

func (p *Plan) SetBuffer(name, data string)

SetBuffer records text stored in a tmux buffer.

It mirrors Server.SetBuffer. It acts on the server, so it takes no target.

func (*Plan) SetEnvironment

func (p *Plan) SetEnvironment(target Ref, name, value string)

SetEnvironment records a variable set in the session target names, or in the server when target is the zero Ref.

It mirrors Server.SetEnvironment and Session.SetEnvironment.

func (*Plan) SetHook

func (p *Plan) SetHook(target Ref, name, command string, global bool)

SetHook records a tmux hook written on the object target names.

It mirrors the generated hook writers, taking the hook's tmux name for the reason Plan.SetOption takes an option's.

func (*Plan) SetOption

func (p *Plan) SetOption(target Ref, request SetPlanOptionRequest)

SetOption records a tmux option written on the object target names, or on the server when target is the zero Ref and Global is set.

It mirrors the generated option writers, taking the option's tmux name rather than its typed accessor: a plan records a command, and the typed accessors read the value back after writing it.

func (*Plan) SetPaneTitle

func (p *Plan) SetPaneTitle(target Ref, title string)

SetPaneTitle records a title for the pane target names.

It mirrors Pane.SetTitle.

func (*Plan) SourceFile

func (p *Plan) SourceFile(request SourceFileRequest)

SourceFile records a tmux configuration file being loaded.

It mirrors Server.SourceFile and takes the same request. It acts on the server rather than on an object, so it takes no target.

func (*Plan) SplitPane

func (p *Plan) SplitPane(target Ref, request SplitPaneRequest) Ref

SplitPane records a split of the window or pane target names, and returns a Ref to the pane it will create.

It mirrors Window.SplitPane and Pane.Split and takes the same request. The returned ref can target later steps before the pane exists:

plan := tmux.NewPlan()
pane := plan.SplitPane(window.Ref(), tmux.SplitPaneRequest{})
plan.SendKeys(pane, tmux.SendKeysRequest{Command: tmux.Ptr("top")})
result, err := plan.Run(ctx, server)

func (*Plan) StartServer

func (p *Plan) StartServer()

StartServer records the tmux server being started if it is not running.

It mirrors Server.Start. It acts on the server, so it takes no target.

func (*Plan) SuspendClient

func (p *Plan) SuspendClient(client ClientName)

SuspendClient records one client being suspended.

It mirrors Server.SuspendClient.

func (*Plan) SwapPane

func (p *Plan) SwapPane(target, source Ref, detach, keepZoom bool)

SwapPane records the panes target and source name exchanging places.

It mirrors Pane.Swap, but names both panes rather than taking that method's request: the request selects the other pane as a materialized Pane, and a plan needs to be able to name one an earlier step will create. Detach leaves the active-pane selection alone, and KeepZoom preserves a zoomed window.

func (*Plan) SwapWindow

func (p *Plan) SwapWindow(target, source Ref, detach bool)

SwapWindow records the windows target and source name exchanging places.

It mirrors Window.Swap. Detach leaves each session's current window alone.

func (*Plan) SwitchClient

func (p *Plan) SwitchClient(target Ref, client ClientName)

SwitchClient records one client being moved to the session target names.

It mirrors Server.SwitchClient and Session.SwitchClient. The session is a Ref, so a client can be switched to a session the plan is about to create.

func (*Plan) UnlinkWindow

func (p *Plan) UnlinkWindow(target Ref, request UnlinkWindowRequest)

UnlinkWindow records the window target names being removed from the session it is linked into.

It mirrors Window.Unlink and takes the same request.

func (*Plan) UnsetEnvironment

func (p *Plan) UnsetEnvironment(target Ref, name string)

UnsetEnvironment records a variable removed from the session target names, or from the server when target is the zero Ref.

It mirrors Server.UnsetEnvironment and Session.UnsetEnvironment.

type PlanError

type PlanError struct {
	// Step is the zero-based index of the operation at fault.
	Step int
	// Reason describes what makes the plan unrunnable.
	Reason string
}

PlanError reports a plan this package refused before sending anything to tmux. It matches ErrPlan through errors.Is; callers can recover Step and Reason with errors.As.

func (*PlanError) Error

func (e *PlanError) Error() string

Error implements error.

func (*PlanError) Unwrap

func (e *PlanError) Unwrap() error

Unwrap makes PlanError compatible with ErrPlan.

type PlanResult

type PlanResult struct {
	// Ops holds one result per recorded operation, in the order recorded.
	Ops []OpResult
}

PlanResult reports what running a Plan did, one entry per recorded operation, in the order they were recorded.

func (PlanResult) Err

func (r PlanResult) Err() error

Err returns the first failed operation's error, or nil when every operation completed.

func (PlanResult) OK

func (r PlanResult) OK() bool

OK reports whether every operation completed.

type Planner

type Planner interface {
	// Plan returns the ordered dispatches for ops.
	Plan(ops []Op) []Dispatch
}

Planner decides how a plan's operations are grouped into tmux invocations.

It is pure policy: the same operations produce the same results whichever planner groups them, and only the number of times tmux is invoked changes. Planners are values rather than names in a registry, so selecting one is a compiler-checked expression and a caller can supply their own.

A planner decides how many tmux invocations there are. It does not decide what runs: its dispatches must carry every operation exactly once, in the order it was recorded, because reordering two tmux commands changes what they do. Plan.Run refuses a grouping that does not, before anything reaches tmux.

A planner must also not group an operation whose Op.Chainable is false. tmux answers a command list with one merged stdout, so grouping one that prints something would attribute its output to whichever operation the plan asked about; Plan.Run refuses such a dispatch rather than reporting a result it cannot stand behind.

type PopupBorderLines

type PopupBorderLines string

PopupBorderLines is a typed value for the "popup-border-lines" tmux option. Its zero value is invalid.

const (
	// PopupBorderLinesSingle selects "single".
	PopupBorderLinesSingle PopupBorderLines = "single"
	// PopupBorderLinesDouble selects "double".
	PopupBorderLinesDouble PopupBorderLines = "double"
	// PopupBorderLinesHeavy selects "heavy".
	PopupBorderLinesHeavy PopupBorderLines = "heavy"
	// PopupBorderLinesSimple selects "simple".
	PopupBorderLinesSimple PopupBorderLines = "simple"
	// PopupBorderLinesRounded selects "rounded".
	PopupBorderLinesRounded PopupBorderLines = "rounded"
	// PopupBorderLinesPadded selects "padded".
	PopupBorderLinesPadded PopupBorderLines = "padded"
	// PopupBorderLinesNone selects "none".
	PopupBorderLinesNone PopupBorderLines = "none"
)

func (PopupBorderLines) String

func (v PopupBorderLines) String() string

String returns the exact tmux spelling of v.

func (PopupBorderLines) Valid

func (v PopupBorderLines) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PrefixKey

type PrefixKey uint8

PrefixKey selects the primary or secondary tmux prefix key. Its zero value selects the primary prefix.

const (
	// PrefixPrimary selects tmux's primary prefix key.
	PrefixPrimary PrefixKey = iota
	// PrefixSecondary selects tmux's secondary prefix key.
	PrefixSecondary
)

type PromptCommandCursorStyle

type PromptCommandCursorStyle string

PromptCommandCursorStyle is a typed value for the "prompt-command-cursor-style" tmux option. Its zero value is invalid.

const (
	// PromptCommandCursorStyleDefault selects "default".
	PromptCommandCursorStyleDefault PromptCommandCursorStyle = "default"
	// PromptCommandCursorStyleBlinkingBlock selects "blinking-block".
	PromptCommandCursorStyleBlinkingBlock PromptCommandCursorStyle = "blinking-block"
	// PromptCommandCursorStyleBlock selects "block".
	PromptCommandCursorStyleBlock PromptCommandCursorStyle = "block"
	// PromptCommandCursorStyleBlinkingUnderline selects "blinking-underline".
	PromptCommandCursorStyleBlinkingUnderline PromptCommandCursorStyle = "blinking-underline"
	// PromptCommandCursorStyleUnderline selects "underline".
	PromptCommandCursorStyleUnderline PromptCommandCursorStyle = "underline"
	// PromptCommandCursorStyleBlinkingBar selects "blinking-bar".
	PromptCommandCursorStyleBlinkingBar PromptCommandCursorStyle = "blinking-bar"
	// PromptCommandCursorStyleBar selects "bar".
	PromptCommandCursorStyleBar PromptCommandCursorStyle = "bar"
)

func (PromptCommandCursorStyle) String

func (v PromptCommandCursorStyle) String() string

String returns the exact tmux spelling of v.

func (PromptCommandCursorStyle) Valid

func (v PromptCommandCursorStyle) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PromptCursorStyle

type PromptCursorStyle string

PromptCursorStyle is a typed value for the "prompt-cursor-style" tmux option. Its zero value is invalid.

const (
	// PromptCursorStyleDefault selects "default".
	PromptCursorStyleDefault PromptCursorStyle = "default"
	// PromptCursorStyleBlinkingBlock selects "blinking-block".
	PromptCursorStyleBlinkingBlock PromptCursorStyle = "blinking-block"
	// PromptCursorStyleBlock selects "block".
	PromptCursorStyleBlock PromptCursorStyle = "block"
	// PromptCursorStyleBlinkingUnderline selects "blinking-underline".
	PromptCursorStyleBlinkingUnderline PromptCursorStyle = "blinking-underline"
	// PromptCursorStyleUnderline selects "underline".
	PromptCursorStyleUnderline PromptCursorStyle = "underline"
	// PromptCursorStyleBlinkingBar selects "blinking-bar".
	PromptCursorStyleBlinkingBar PromptCursorStyle = "blinking-bar"
	// PromptCursorStyleBar selects "bar".
	PromptCursorStyleBar PromptCursorStyle = "bar"
)

func (PromptCursorStyle) String

func (v PromptCursorStyle) String() string

String returns the exact tmux spelling of v.

func (PromptCursorStyle) Valid

func (v PromptCursorStyle) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type PromptHistoryRequest

type PromptHistoryRequest struct {
	// Type selects a prompt-history class; zero selects all classes.
	Type PromptType
}

PromptHistoryRequest selects one prompt-history class. A zero request selects every class.

type PromptType

type PromptType uint8

PromptType selects one closed tmux prompt-history class. The zero value selects all prompt types.

const (
	// PromptTypeAll selects every prompt-history class and omits -T.
	PromptTypeAll PromptType = iota
	// PromptTypeCommand selects command-prompt history.
	PromptTypeCommand
	// PromptTypeSearch selects search-prompt history.
	PromptTypeSearch
	// PromptTypeTarget selects target-prompt history.
	PromptTypeTarget
	// PromptTypeWindowTarget selects window-target-prompt history.
	PromptTypeWindowTarget
)

Supported tmux prompt-history classes.

type Ref

type Ref struct {
	// contains filtered or unexported fields
}

Ref addresses a tmux object a Plan will act on. It is either an object that already exists, from Session.Ref, Window.Ref, or Pane.Ref, or the one a recorded step is going to create, from the Plan method that recorded it.

A ref to something that does not exist yet is what lets a plan be built in one pass: a split can be recorded, and keys sent to the pane it will create, before tmux has been asked for anything.

The zero Ref addresses nothing, and a plan holding one refuses to run rather than guessing what was meant.

func PaneRef

func PaneRef(id PaneID) Ref

PaneRef returns a Ref addressing a pane by ID, for a caller holding an identifier rather than a record.

func SessionRef

func SessionRef(id SessionID) Ref

SessionRef returns a Ref addressing a session by ID, for a caller holding an identifier rather than a record.

func WindowRef

func WindowRef(id WindowID) Ref

WindowRef returns a Ref addressing a window by ID, for a caller holding an identifier rather than a record.

func (Ref) String

func (r Ref) String() string

String returns the target a Ref resolves to, or a placeholder naming the step that will produce it.

type RefreshClientRequest

type RefreshClientRequest struct {
	// TargetClient selects a stable client; zero selects tmux's current client.
	TargetClient ClientName
	// RequestClipboard requests clipboard data; tmux before 3.4 ends the server on it, so it is withheld; see UnsupportedPolicy.
	RequestClipboard bool
}

RefreshClientRequest configures refreshing one tmux client. Its zero value refreshes tmux's current client; a zero TargetClient omits -t.

type RemainOnExit

type RemainOnExit string

RemainOnExit is a typed value for the "remain-on-exit" tmux option. Its zero value is invalid.

const (
	// RemainOnExitOff selects "off".
	RemainOnExitOff RemainOnExit = "off"
	// RemainOnExitOn selects "on".
	RemainOnExitOn RemainOnExit = "on"
	// RemainOnExitFailed selects "failed".
	RemainOnExitFailed RemainOnExit = "failed"
	// RemainOnExitKey selects "key".
	RemainOnExitKey RemainOnExit = "key"
)

func (RemainOnExit) String

func (v RemainOnExit) String() string

String returns the exact tmux spelling of v.

func (RemainOnExit) Valid

func (v RemainOnExit) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type ResizePaneRequest

type ResizePaneRequest struct {
	// Direction selects a directional resize and requires Adjustment.
	Direction PaneResizeDirection
	// Adjustment is the positive number of cells moved in Direction. It must
	// be zero when Direction is PaneResizeDirectionNone.
	Adjustment int
	// Height sets an absolute or percentage height. A zero PaneSize omits it.
	Height PaneSize
	// Width sets an absolute or percentage width. A zero PaneSize omits it.
	Width PaneSize
	// Zoom toggles the pane between its normal layout and full-window zoom.
	Zoom bool
	// Mouse begins tmux mouse resizing and is meaningful from a mouse binding.
	Mouse bool
	// TrimBelow removes lines below the cursor and refills from history.
	TrimBelow bool
}

ResizePaneRequest selects one resize mode. Direction with Adjustment, dimensions, Zoom, Mouse, and TrimBelow are mutually exclusive modes; Height and Width may be set together. Its zero value sends a bare tmux resize-pane command rather than selecting a mode. When Direction is PaneResizeDirectionNone, Adjustment must be zero.

type ResizeWindowRequest

type ResizeWindowRequest struct {
	// Direction selects a directional adjustment; zero selects another mode.
	Direction WindowResizeDirection
	// Adjustment is the required positive amount for Direction; zero omits it.
	Adjustment int
	// Height sets a positive manual height; zero preserves the current height.
	Height int
	// Width sets a positive manual width; zero preserves the current width.
	Width int
	// Expand sets the window to the size of the largest session containing it.
	Expand bool
	// Shrink sets the window to the size of the smallest session containing it.
	Shrink bool
}

ResizeWindowRequest selects one directional, manual, expand, or shrink operation. Height and Width may be set together. A zero request asks tmux to reapply the current manual size. Direction requires a positive Adjustment; that pair, dimensions, Expand, and Shrink are mutually exclusive and are validated before execution. Zero Adjustment, Height, and Width omit their modes; nonzero values must be positive. The request is supported on tmux 3.2a or later.

type RespawnRequest

type RespawnRequest struct {
	// Command is omitted when nil so tmux reuses the stored command. A
	// nonnil empty string remains an explicit operand.
	Command *string
	// StartDirectory expands ~ and ~/... for the current user. Nil reuses the
	// stored directory; a nonnil empty string selects the current directory.
	StartDirectory *string
	// Environment is emitted in lexically sorted key order; nil and an empty map
	// both add no environment entries.
	Environment map[string]string
	// Kill terminates an active target process before restarting it.
	Kill bool
}

RespawnRequest configures restarting a window's or pane's process on tmux 3.2a or later. Its zero value reuses the stored command and directory and requires the target process to be inactive. Nil pointer fields omit their options; nonnil pointers are explicit, including empty strings. There are no mutually exclusive fields. Arguments and environment entries are validated before execution.

Respawn methods read pointer and map values during argument construction and retain none of that caller-owned storage. Callers must not mutate those values concurrently; this request does not provide a broader goroutine-safety guarantee.

type RotateWindowDirection

type RotateWindowDirection uint8

RotateWindowDirection selects rotate-window's direction on tmux 3.2a or later. Its zero value uses tmux's default rotation.

const (
	// RotateWindowDefault uses tmux's default rotation.
	RotateWindowDefault RotateWindowDirection = iota
	// RotateWindowUp rotates pane positions toward lower indexes.
	RotateWindowUp
	// RotateWindowDown rotates pane positions toward higher indexes.
	RotateWindowDown
)

Supported window-rotation directions.

type RotateWindowRequest

type RotateWindowRequest struct {
	// Direction selects the rotation direction; zero uses tmux's default.
	Direction RotateWindowDirection
	// KeepZoom preserves the window's zoomed state.
	KeepZoom bool
}

RotateWindowRequest configures rotate-window on tmux 3.2a or later. Its zero value uses tmux's default rotation. Enum range validation happens before execution; the request contains no retained caller-owned storage.

type RunShellRequest

type RunShellRequest struct {
	// Command is the required shell or tmux command to run.
	Command string
	// Background returns after tmux accepts the job instead of waiting for stdout.
	Background bool
	// Delay supplies run-shell's optional delay; nil omits it and an empty value is explicit.
	Delay *string
	// AsTmuxCommand asks tmux to interpret Command as tmux command syntax.
	AsTmuxCommand bool
	// TargetPane selects a stable pane target; its zero value leaves target selection to tmux.
	TargetPane PaneID
	// StartDirectory selects the job directory; nil omits it and tmux before 3.4 refuses it; see UnsupportedPolicy.
	StartDirectory *string
	// ShowStderr requests job stderr; tmux before 3.6 refuses it; see UnsupportedPolicy.
	ShowStderr bool
	// Args are extra job arguments copied before tmux runs; tmux before 3.7 refuses it; see UnsupportedPolicy.
	Args []string
}

RunShellRequest configures a command executed by tmux's run-shell command. Its zero value is invalid because Command is required. Pointer fields distinguish omitted flags from explicit empty arguments; RunShell copies Delay, StartDirectory, and Args before invoking tmux.

type SaveBufferRequest

type SaveBufferRequest struct {
	// Path is the required output file path.
	Path string
	// Name selects a named buffer, or nil for tmux's most-recent buffer.
	Name *string
	// Append appends buffer data to Path instead of replacing its contents.
	Append bool
}

SaveBufferRequest configures writing a tmux paste buffer to a file. Its zero value is invalid because Path is required; nil Name selects the most-recent buffer and a pointer to an empty name is explicit.

type SelectLayoutRequest

type SelectLayoutRequest struct {
	// Layout names a preset or supplies a tmux layout string; empty selects the
	// zero-value behavior.
	Layout string
	// Spread distributes pane space evenly.
	Spread bool
	// Next selects the next preset layout.
	Next bool
	// Previous selects the previous preset layout.
	Previous bool
}

SelectLayoutRequest selects one layout operation. Its zero value reapplies the last preset layout. Layout, Spread, Next, and Previous are mutually exclusive and are validated before execution; an empty Layout is omitted rather than passed explicitly. The request contains no retained caller-owned storage and is supported on tmux 3.2a or later.

type SelectWindowRequest

type SelectWindowRequest struct {
	// WindowID selects a stable window linked into the receiver session.
	WindowID WindowID
	// Index selects a nonnegative winlink index in the receiver session.
	Index *int
}

SelectWindowRequest selects one winlink in a Session on tmux 3.2a or later. Its zero value is invalid: exactly one of WindowID and Index is required. That mutual exclusion, stable-ID syntax, and a nonnegative Index are validated before execution. Index is read during the call and is not retained; nil omits it, a nonnil pointer is explicit, and callers must not mutate it concurrently.

type SendKeysRequest

type SendKeysRequest struct {
	// Command is one tmux key operand. Nil selects a flag-only invocation;
	// nonnil, including an empty string, supplies the operand.
	Command *string
	// SkipEnter prevents the separate Enter key sent after Command.
	SkipEnter bool
	// SuppressHistory prefixes Command with one space. Whether that excludes
	// the text from history depends on the application or shell in the pane.
	SuppressHistory bool
	// Literal disables tmux key-name lookup and treats Command as literal UTF-8.
	// It does not bypass interpretation by the pane's application or shell.
	Literal bool
	// Reset asks tmux to reset terminal state before processing key input.
	Reset bool
	// CopyModeCommand sends a tmux copy-mode command instead of Command. A
	// nonnil empty string remains an explicit operand.
	CopyModeCommand *string
	// Repeat repeats the key input a positive number of times. Zero omits the
	// repeat count.
	Repeat int
	// ExpandFormats asks tmux to expand format expressions in key operands.
	ExpandFormats bool
	// HexKeys interprets key operands as hexadecimal ASCII values and takes
	// precedence over Literal.
	HexKeys bool
	// TargetClient selects the client used by KeyName. Zero leaves client
	// selection to tmux; without KeyName it does not redirect pane input.
	TargetClient ClientName
	// KeyName routes keys through the selected client's key table rather than
	// delivering them to the pane.
	KeyName bool
}

SendKeysRequest configures tmux key input. Command and CopyModeCommand are read and copied before any version probe or command, and the call retains none of the caller's storage. Callers must not mutate those values concurrently.

Command must be nonnil unless Reset, Repeat, or CopyModeCommand is set. A nonnil empty Command is an explicit key operand and is followed by Enter unless SkipEnter is set. CopyModeCommand takes precedence over Command and suppresses Enter. HexKeys takes precedence over Literal when both are set.

type Sequential

type Sequential struct{}

Sequential sends every operation as its own tmux invocation. It is the simplest correct planner, and useful as a baseline: a plan produces the same results through it as through Folding, at one invocation per operation.

func (Sequential) Plan

func (Sequential) Plan(ops []Op) []Dispatch

Plan returns one dispatch per operation.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is an immutable handle to one tmux configuration. Its zero value targets tmux's default binary, socket, configuration, and environment. Copying a Server preserves its configuration and shares version-cache coordination; only the documented concurrent operations are safe to share.

func NewServer

func NewServer(options ServerOptions) Server

NewServer returns a configured server handle without executing tmux. Empty socket selectors retain tmux's default configuration.

Example
package main

import (
	"fmt"

	"github.com/libtmux/libtmux-go/tmux"
)

func main() {
	// NewServer records configuration; it does not start tmux.
	server := tmux.NewServer(tmux.ServerOptions{SocketPath: "/tmp/libtmux-go-example.sock"})

	fmt.Println(server.SocketPath())
}
Output:
/tmp/libtmux-go-example.sock

func NewServerFromEnv

func NewServerFromEnv(environment map[string]string) (Server, error)

NewServerFromEnv returns a server configured from TMUX without executing tmux. A nil environment reads the process environment; a non-nil empty map does not.

func (Server) AppendOption

func (s Server) AppendOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

AppendOption appends to a server-scope option without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.

func (Server) AttachSession

func (s Server) AttachSession(ctx context.Context, request AttachSessionRequest) error

AttachSession attaches the caller's terminal to a matching session and blocks until detach or context cancellation. Nil standard streams inherit the process streams; each stream must be a concrete terminal descriptor. The call retains caller-supplied files while attached and never owns or closes them. A completed nonzero exit returns CommandError; cancellation can end waiting but does not prove that attachment or detachment did not occur.

func (Server) BindKey

func (s Server) BindKey(ctx context.Context, request BindKeyRequest) error

BindKey binds Key to Command in a tmux key table. An empty Command creates a no-op binding on tmux 3.3 or newer; tmux 3.2a reports its upstream error. It mutates the table; cancellation does not prove that tmux did not bind Key.

func (Server) ClearPromptHistory

func (s Server) ClearPromptHistory(
	ctx context.Context,
	request PromptHistoryRequest,
) error

ClearPromptHistory clears all tmux prompt history or one selected class. Version, transport, and completed-stderr failures are returned. It requires tmux 3.3 or later and returns VersionTooLowError below that floor.

func (Server) Client

func (s Server) Client(ctx context.Context, name ClientName) (Client, error)

Client performs a canonical live lookup of name and returns a newly materialized record. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

Example
package main

import (
	"context"
	"errors"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-client-lookup",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// A detached server has no clients, so the lookup reports absence as a
	// classified error rather than an empty value.
	_, err := server.Client(ctx, tmux.ClientName("/dev/pts/999"))
	fmt.Println(errors.Is(err, tmux.ErrSnapshotNotFound))
}
Output:
true

func (Server) Clients

func (s Server) Clients(ctx context.Context) ([]Client, error)

Clients materializes attached tmux client records. A tmux command or transport failure is returned rather than answered with no rows, so an empty result means the server held nothing; ErrNoServer classifies a server that was not reached. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Server) Cmd

func (s Server) Cmd(ctx context.Context, args ...string) (CommandResult, error)

Cmd executes raw tmux arguments. A completed nonzero tmux exit remains in the returned CommandResult; validation and transport failures return an error. Cmd clones result slices, so the caller owns Command, decoded Stdout, exact RawStdout, and decoded Stderr. Canceling ctx stops the wait for the command but cannot determine whether a mutating command reached tmux.

An argument that is exactly ";" separates two tmux commands, so one call can submit a command list. tmux runs a list until a command fails and drops the rest, and answers with one merged stdout, so a caller that needs to know which command produced which line submits them separately. A list means the same thing through every transport.

Only a standalone ";" is a separator. A semicolon inside a larger argument is left to tmux's own parsing, which differs by transport: a tmux process hands the argument to tmux's outer command parser, which consumes a trailing semicolon, while a control connection quotes the argument and keeps it. Pass values through the typed operations rather than here when that matters; they are literal through either transport.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-cmd",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// Cmd runs a tmux command this package has no typed method for. It reports
	// tmux's own failure through the result rather than through err, which is
	// reserved for the command not running at all.
	result, err := server.Cmd(ctx, "display-message", "-p", "#{session_name}")
	if err != nil {
		fmt.Println("run display-message:", err)
		return
	}
	if result.ExitCode != 0 {
		fmt.Println(result.Stderr)
		return
	}
	fmt.Println(result.Stdout)
	fmt.Printf("%q\n", result.RawStdout)
}
Output:
[build]
"build\n"

func (Server) CommandPrompt

func (s Server) CommandPrompt(ctx context.Context, request CommandPromptRequest) error

CommandPrompt asks tmux to display a background command prompt and returns after tmux accepts it, not after input is submitted or Template runs. It requires tmux 3.3. Unsupported later flags synchronously reach WarningHandler before the reduced command runs. Completed stderr is an error; cancellation does not prove prompt delivery or later execution did not occur.

func (Server) ConfigFile

func (s Server) ConfigFile() string

ConfigFile returns the configured tmux configuration path.

func (Server) ConfirmBefore

func (s Server) ConfirmBefore(ctx context.Context, request ConfirmBeforeRequest) error

ConfirmBefore asks tmux to display a background confirmation prompt and returns after tmux accepts it, not after the user answers or Command runs. It requires tmux 3.3. ConfirmKey and DefaultYes require tmux 3.4 and are synchronously reported to WarningHandler before the reduced command runs on older supported versions. Completed stderr is an error; cancellation does not prove prompt delivery or later command execution did not occur.

func (Server) DeleteBuffer

func (s Server) DeleteBuffer(ctx context.Context, name *string) error

DeleteBuffer deletes a named buffer, or the most recent buffer when name is nil. Cancellation does not prove that tmux did not delete the buffer.

func (Server) DetachAllClients

func (s Server) DetachAllClients(
	ctx context.Context,
	request DetachAllClientsRequest,
) error

DetachAllClients detaches every client except KeepClient or tmux's current client. Cancellation does not prove every client was detached.

func (Server) DetachClient

func (s Server) DetachClient(ctx context.Context, request DetachClientRequest) error

DetachClient detaches one client, or tmux's current client when no target is set. A completed stderr result is an error; cancellation does not prove delivery or detachment did not occur.

func (Server) DisplayMenu

func (s Server) DisplayMenu(ctx context.Context, request DisplayMenuRequest) error

DisplayMenu displays a menu and waits until tmux closes it. The target client must own a TTY; control-mode clients cannot render menu overlays. It returns no selected value and does not establish whether an item command ran. Unsupported optional flags synchronously reach WarningHandler before the reduced command runs; completed stderr is an error, and cancellation does not prove menu delivery or any selected command's effect.

func (Server) DisplayMessage

func (s Server) DisplayMessage(
	ctx context.Context,
	request DisplayMessageRequest,
) ([]string, error)

DisplayMessage displays or prints a server-scoped tmux message. Print returns an owned stdout slice even when tmux exits nonzero; completed stderr is delivered synchronously through WarningCommandStderr, not returned as a completed-error classification. Unsupported flags and completed stderr reach the caller-goroutine WarningHandler before this call returns. Cancellation does not prove display did not occur.

func (Server) Engine

func (s Server) Engine() Engine

Engine returns the engine this handle routes through, or nil when every command starts a tmux process.

It is the read half of Server.WithEngine, and exists so that code handed a Server can tell whether its caller already chose a transport. A library that opens a connection of its own should not do so on a handle whose owner has already decided: passing Server.SubprocessEngine is how that owner says to stay on processes, and silently overriding it would make the choice unobservable.

func (Server) Equal

func (s Server) Equal(other Server) bool

Equal reports whether both handles have the same configured socket selector. It does not resolve environment-dependent named or default socket paths.

func (Server) GetEnvironment

func (s Server) GetEnvironment(
	ctx context.Context,
	name string,
) (EnvironmentValue, bool, error)

GetEnvironment returns one non-hidden global environment entry. A missing or hidden variable reports ok false.

func (Server) GlobalSessionScope

func (s Server) GlobalSessionScope() GlobalSessionScope

GlobalSessionScope returns a handle that preserves s and its error policy.

func (Server) GlobalWindowScope

func (s Server) GlobalWindowScope() GlobalWindowScope

GlobalWindowScope returns a handle that preserves s and its error policy.

func (Server) HasSession

func (s Server) HasSession(ctx context.Context, request HasSessionRequest) (bool, error)

HasSession reports whether the configured tmux server has a matching session without changing it. Pattern false answers for the name itself; Pattern true preserves tmux's session-pattern semantics, where a target may also name a session by identifier, by the tty of a client attached to it, by unique prefix, or by glob. Completed nonzero exits are predicate misses. Local validation errors match ErrInvalidServerCommandRequest or ErrInvalidRequest; transport and context failures remain errors.

The exact question is answered against the session list rather than by tmux's exact-match marker, because that marker suppresses only the last two rungs of tmux's ladder: "=$0" still resolves the identifier, and "=/dev/pts/3" still resolves the client, so both report a session nothing is named.

func (Server) IfShell

func (s Server) IfShell(ctx context.Context, request IfShellRequest) error

IfShell executes ThenCommand when ShellCommand succeeds and ElseCommand, if present, when it fails. A completed stderr result is an error; cancellation can interrupt delivery without proving that tmux did not execute a branch.

func (Server) IsAlive

func (s Server) IsAlive(ctx context.Context) (bool, error)

IsAlive reports whether a tmux server answers on the configured socket. Only an absent server reports false without an error: a socket that exists but cannot be reached, such as one the process may not read, is a question that could not be answered and is returned as an error.

func (Server) Kill

func (s Server) Kill(ctx context.Context) error

Kill terminates the configured tmux server and all of its sessions, windows, panes, and clients. After a completed failed kill, a liveness probe makes repeated calls harmless when no daemon answers. Transport or context errors can be delivery-ambiguous; no rollback is attempted.

tmux leaves the socket file in place, so cleanup that waits for the path to disappear does not finish. Use Server.IsAlive to observe the daemon, and remove a socket path this process chose itself.

func (Server) KillSession

func (s Server) KillSession(ctx context.Context, target string) error

KillSession terminates the session selected by tmux target syntax. Pattern and prefix matching are deliberately left to tmux. Completed nonzero exits without stderr are ignored by this operation's source contract. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Server) ListBuffers

func (s Server) ListBuffers(
	ctx context.Context,
	request ListBuffersRequest,
) ([]string, error)

ListBuffers returns an owned snapshot of live tmux buffer rows. A command or transport failure is returned rather than answered with no rows; context cancellation still returns its context error. The result is not a live collection.

func (Server) ListClients

func (s Server) ListClients(ctx context.Context) ([]string, error)

ListClients returns an owned snapshot of raw tmux client-description lines. A list failure is returned rather than answered with no rows.

func (Server) ListCommands

func (s Server) ListCommands(
	ctx context.Context,
	request ListCommandsRequest,
) ([]string, error)

ListCommands returns an owned snapshot of raw tmux command-description lines. A list failure is returned rather than answered with no rows. Like Server.ListKeys, it answers on a socket holding no server.

func (Server) ListKeys

func (s Server) ListKeys(
	ctx context.Context,
	request ListKeysRequest,
) ([]string, error)

ListKeys returns an owned snapshot of raw tmux key-binding lines. Format requires tmux 3.7 or newer; older versions synchronously deliver a warning to the caller-goroutine WarningHandler before running the reduced command with tmux's default format. tmux 3.7, 3.7a, 3.7b, and 3.7c redirect a table's sole matching binding to a client status message, leaving stdout empty; this method preserves that upstream and Python behavior. Development tmux has corrected the issue. A list failure is returned rather than answered with no rows.

It answers on a socket holding no server, unlike every other list here, because tmux runs list-keys against a server it starts for the purpose. That server holds no sessions and exits at once, leaving its socket file behind.

func (Server) LoadBuffer

func (s Server) LoadBuffer(ctx context.Context, request LoadBufferRequest) error

LoadBuffer reads a file into a named or newly allocated buffer. Path follows Server.SourceFile's current-user expansion and lexical normalization. It mutates tmux's destination buffer and rejects exact "-" because no process stdio is exposed.

func (Server) LockClient

func (s Server) LockClient(ctx context.Context, targetClient *ClientName) error

LockClient locks a client, or tmux's current client when targetClient is nil. Cancellation does not prove the target client was not locked.

func (Server) LockServer

func (s Server) LockServer(ctx context.Context) error

LockServer locks every attached client on the tmux server. Cancellation does not prove the server did not lock a client.

func (Server) NewSession

func (s Server) NewSession(ctx context.Context, request NewSessionRequest) (Session, error)

NewSession creates a detached session, then returns a newly materialized live Session. It never changes client focus. KillExisting may destroy the old named session before a later creation failure; no rollback is attempted. A transport or context error can be delivery-ambiguous.

The returned Session is a session-only point lookup, so its Session.Windows and Session.Panes relations are empty even though tmux creates an initial window and pane. Use Session.ResolveActiveWindow, Session.ResolveActivePane, or Server.Snapshot when those related records are needed.

When tmux prints a valid stable identity before a transport failure, or creation succeeds but the live lookup fails, NewSession returns a partial Session containing its creating Server and SessionID with the error. Other failures return a zero Session. See ErrSessionExists, ErrInvalidCommandOutput, ErrInvalidRequest, and CommandError.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-new-session",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	name, ok := session.Name()
	fmt.Println(name, ok)
}
Output:
build true

func (Server) OpenControl

func (s Server) OpenControl(
	ctx context.Context,
	session Session,
) (*ControlClient, error)

OpenControl starts a control-mode client attached to session. The startup context bounds process start, attach framing, and client registration but does not own the returned client's lifetime. Session must belong to the same configured server selector.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-open-control",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	client, err := server.OpenControl(ctx, session)
	if err != nil {
		fmt.Println("open control:", err)
		return
	}
	defer func() {
		closeCtx, closeCancel := context.WithTimeout(context.Background(), 5*time.Second)
		defer closeCancel()
		_ = client.CloseContext(closeCtx)
	}()

	result, err := client.Cmd(ctx, "display-message", "-p", "ready")
	if err != nil || result.Failed {
		fmt.Println("command over the control client:", err)
		return
	}

	// A control frame carries its payload bytes, line feed included, rather
	// than a decoded string: the frame is what tmux sent.
	fmt.Printf("%q\n", result.RawStdout)

	// Reconnect replaces the client with one on a new attachment. The old one
	// is spent, so the result is what later commands go through.
	reconnected, err := client.Reconnect(ctx)
	if err != nil {
		fmt.Println("reconnect:", err)
		return
	}
	client = reconnected

	result, err = client.Cmd(ctx, "display-message", "-p", "still here")
	if err != nil {
		fmt.Println("command after reconnecting:", err)
		return
	}
	fmt.Printf("%q\n", result.RawStdout)
}
Output:
"ready\n"
"still here\n"

func (Server) OpenControlPool

func (s Server) OpenControlPool(
	ctx context.Context,
	session Session,
	request ControlPoolRequest,
) (Server, Session, *ControlPool, error)

OpenControlPool returns a Server carrying a control-mode transport, together with the ControlPool that owns it.

It is Server.OpenControl and Server.WithEngine in one call, and unlike them it can hold more than one connection: ControlClient.Cmd serializes, so a single connection carries one tmux command at a time and concurrent callers queue behind each other.

Closing the pool does not invalidate anything derived from the returned handle. Those records go back to starting a tmux process per command and report WarningControlPoolClosed through ServerOptions.WarningHandler, so a function may use a pool internally and return what it built.

session is attached by every connection, because tmux has no unattached control client. Its lifetime governs the pool's: killing it closes the connections attached to it. Passing one the caller already owns is deliberate rather than convenient, since a pool that invented its own session would leave one behind that nobody asked for.

The returned handle is the one to derive records from. A record taken from the original handle keeps starting a process; Pane.WithServer and its counterparts move one across without a lookup.

The transport is otherwise four separate things a caller has to know: open a control client, adapt it to an Engine, select that engine on a handle copy, and look up again every record obtained before the selection, because a record carries the handle that made it and an older record keeps starting tmux processes without reporting anything. Building the connection with the handle retires the last of those. The returned Server is the first handle the program holds, so no record can predate its engine.

The returned handle is an ordinary immutable Server: it copies freely, and every session, window, and pane derived from it carries the transport too. The lifetime lives in the second return value rather than in a Close method on the handle, because a handle is embedded in every record it produces and copied into every one of them, so no copy could own the shutdown of the others.

Construction starts tmux processes: it lists or creates the session, opens each connection, and probes the tmux version once so that a later version-gated operation finds the answer cached rather than starting a process for it. Afterwards every command the connection can carry runs over it. The exceptions are the ones Server.WithEngine documents, since routing is unchanged: interactive attachment, the tmux -V probe, and the reads whose contract is tmux's exact stdout bytes, which are Pane.Capture, Pane.CaptureBytes, and Server.ShowBufferBytes. Pane.CaptureToFile is the capture that stays on the connection.

Failure closes anything it already opened. A caller that receives an error receives no pool to close.

Example

ExampleServer_OpenControlPool puts a handle on a control-mode transport in one call, so the commands that follow start no tmux processes.

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-control-pool",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "work"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	connected, _, pool, err := server.OpenControlPool(ctx, session, tmux.ControlPoolRequest{})
	if err != nil {
		fmt.Println("open pool:", err)
		return
	}
	defer func() { _ = pool.Close() }()

	// The session was taken before the pool existed, so it still carries the
	// forking handle. Moving it across needs no tmux command.
	windows, err := session.WithServer(connected).SearchWindows(ctx, nil)
	if err != nil {
		fmt.Println("search windows:", err)
		return
	}
	fmt.Println("windows read over the connection:", len(windows))
}
Output:
windows read over the connection: 1

func (Server) Options

func (s Server) Options(ctx context.Context) (ServerOptionValues, error)

Options returns a freshly decoded, caller-owned view of known server options, including inherited values. A read or transport failure is returned rather than answered with zero values; context errors propagate. Each returned accessor names the setter that writes it, so ServerOptionValues.BufferLimit pairs with Server.SetBufferLimit.

func (Server) Pane

func (s Server) Pane(ctx context.Context, id PaneID) (Pane, error)

Pane performs a canonical live lookup of id using tmux's canonical session and returns a newly materialized record. It does not preserve a linked-session view; use Pane.ResolveWindow for that exact relationship. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-pane-lookup",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	created, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}

	pane, err := server.Pane(ctx, created.ID())
	if err != nil {
		fmt.Println("look up pane:", err)
		return
	}
	fmt.Println(pane.ID() == created.ID())
}
Output:
true

func (Server) Panes

func (s Server) Panes(ctx context.Context) ([]Pane, error)

Panes materializes pane records for every winlink. A tmux command or transport failure is returned rather than answered with no rows, so an empty result means the server held nothing; ErrNoServer classifies a server that was not reached. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Server) ProcessEnvironment

func (s Server) ProcessEnvironment() []string

ProcessEnvironment returns the configured child-process environment. Nil means commands inherit the current process environment. The returned slice is owned by the caller.

func (Server) RaiseIfDead

func (s Server) RaiseIfDead(ctx context.Context) error

RaiseIfDead returns a CommandError when the configured server is not alive. Cancellation and transport failures are returned directly.

func (Server) RawOption

func (s Server) RawOption(ctx context.Context, name string) (string, bool, error)

RawOption returns one exact server-scope option value. A successful string is caller-owned; ok reports presence. Targeted reads do not use list leniency, and completed failures return a secret-safe option error. An unindexed empty array is indistinguishable from an empty scalar; use Options for typed array presence.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-raw-option",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// An option tmux does not have reports absence through ok, not through err.
	_, ok, err := server.RawOption(ctx, "no-such-option")
	fmt.Println(ok, err)
}
Output:
false <nil>

func (Server) RefreshClient

func (s Server) RefreshClient(ctx context.Context, request RefreshClientRequest) error

RefreshClient redraws a client, or tmux's current client when no target is set. RequestClipboard requires tmux 3.4; older supported versions synchronously call WarningHandler and omit that flag.

func (Server) RefreshVersion

func (s Server) RefreshVersion(ctx context.Context) (Version, error)

RefreshVersion invalidates the cached version and probes the binary again. Canceling ctx stops this call's wait; it does not establish whether a probe reached the configured binary.

func (Server) RemoveEnvironment

func (s Server) RemoveEnvironment(ctx context.Context, name string) error

RemoveEnvironment marks a variable for removal from new process environments.

func (Server) RequireVersion

func (s Server) RequireVersion(ctx context.Context, minimum Version) error

RequireVersion returns a VersionTooLowError matching ErrVersionTooLow when the configured binary is older than minimum.

func (Server) RunShell

func (s Server) RunShell(ctx context.Context, request RunShellRequest) ([]string, error)

RunShell executes a shell command through tmux and returns an owned stdout slice. A background request returns nil after tmux accepts the job. On older supported tmux versions, unsupported optional flags synchronously reach the caller-goroutine WarningHandler before the reduced command runs. A completed stderr result is an error; context cancellation can be observed with errors.Is but does not establish that tmux did not start the job.

func (Server) SaveBuffer

func (s Server) SaveBuffer(ctx context.Context, request SaveBufferRequest) error

SaveBuffer writes a named or most-recent buffer to a file. Path follows Server.SourceFile's current-user expansion and lexical normalization. It changes that file; exact "-" is rejected because the runner exposes no process stdio.

func (Server) SearchClients

func (s Server) SearchClients(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Client, error)

SearchClients returns a newly materialized snapshot projection of clients selected by tmux's live -f expression. A nil filter omits -f and requests the unfiltered listing on every supported tmux version. A nonnil filter, including an empty expression, requires tmux 3.4 or newer and otherwise returns VersionTooLowError. The result is bounded by opening and closing identity probes, not a live collection.

func (Server) SearchPanes

func (s Server) SearchPanes(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Pane, error)

SearchPanes returns a newly materialized snapshot projection of pane views selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. It is bounded by opening and closing identity probes, not a live collection.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-server-search-panes",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// tmux evaluates the filter, so a pane is matched by what it is running
	// rather than by anything this program has to fetch and compare.
	editors := tmux.TmuxFilter("#{==:#{pane_current_command},nvim}")
	matched, err := server.SearchPanes(ctx, &editors)
	if err != nil {
		fmt.Println("search panes:", err)
		return
	}
	fmt.Println("editors:", len(matched))

	// A nil filter asks for every pane.
	all, err := server.SearchPanes(ctx, nil)
	if err != nil {
		fmt.Println("search panes:", err)
		return
	}
	fmt.Println("panes:", len(all))
}
Output:
editors: 0
panes: 1

func (Server) SearchSessions

func (s Server) SearchSessions(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Session, error)

SearchSessions returns a newly materialized snapshot projection of sessions selected by tmux's live -f expression. A nil filter omits -f; a nonnil empty filter remains an explicit empty expression. The result is bounded by opening and closing identity probes, not a live collection.

func (Server) SearchWindows

func (s Server) SearchWindows(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Window, error)

SearchWindows returns a newly materialized snapshot projection of winlinks selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. It is bounded by opening and closing identity probes, not a live collection.

func (Server) ServerAccess

func (s Server) ServerAccess(
	ctx context.Context,
	request ServerAccessRequest,
) ([]string, error)

ServerAccess changes or lists the server access-control entries. It requires tmux 3.3 and returns VersionTooLowError below that floor. List returns an owned snapshot, and reports a completed or transport failure rather than answering with no entries; mutation completed stderr is an error.

func (Server) Session

func (s Server) Session(ctx context.Context, id SessionID) (Session, error)

Session performs a canonical live lookup of id and returns a newly materialized record. Use Session.Refresh when beginning from a record. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-session-lookup",
	})
	defer killExampleServer(server)

	created, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	// A point lookup asks tmux for one object by its stable identifier.
	session, err := server.Session(ctx, created.ID())
	if err != nil {
		fmt.Println("look up session:", err)
		return
	}
	name, _ := session.Name()
	fmt.Println(name)
}
Output:
build

func (Server) Sessions

func (s Server) Sessions(ctx context.Context) ([]Session, error)

Sessions materializes the server's session records. A tmux command or transport failure is returned rather than answered with no rows, so an empty result means the server held nothing; ErrNoServer classifies a server that was not reached. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-sessions",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{
		Name: "build", WindowName: "editor",
	}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// Sessions resolves the hierarchy, so each record carries its windows and
	// each window its panes. Reading them costs no further tmux command.
	sessions, err := server.Sessions(ctx)
	if err != nil {
		fmt.Println("list sessions:", err)
		return
	}
	for _, session := range sessions {
		name, _ := session.Name()
		windows, _ := session.Windows()
		for _, window := range windows {
			windowName, _ := window.Name()
			panes, _ := window.Panes()
			fmt.Println(name, windowName, len(panes))
		}
	}
}
Output:
build editor 1

func (Server) SetBackspace

func (s Server) SetBackspace(ctx context.Context, value string) error

SetBackspace stores the "backspace" server option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with ServerOptionValues.Backspace from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetBuffer

func (s Server) SetBuffer(ctx context.Context, request SetBufferRequest) error

SetBuffer stores or appends exact string data without refreshing models. It mutates the selected paste buffer; completed stderr is reported as a redacted command error because Data may be secret. Cancellation does not prove that tmux did not store data.

func (Server) SetBufferLimit

func (s Server) SetBufferLimit(ctx context.Context, value int64) error

SetBufferLimit stores the "buffer-limit" server option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with ServerOptionValues.BufferLimit from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetClipboard

func (s Server) SetClipboard(ctx context.Context, value SetClipboard) error

SetClipboard stores the "set-clipboard" server option, available since tmux 3.2a. It accepts SetClipboard and does not expose raw set-option flags. Read it back with ServerOptionValues.SetClipboard from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetCodepointWidths

func (s Server) SetCodepointWidths(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetCodepointWidths performs a complete replacement of the "codepoint-widths" server option, available since tmux 3.6. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with ServerOptionValues.CodepointWidths from Server.Options. Use Server.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Server.UnsetOption to restore inheritance or the global default.

func (Server) SetCommandAlias

func (s Server) SetCommandAlias(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetCommandAlias performs a complete replacement of the "command-alias" server option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with ServerOptionValues.CommandAlias from Server.Options. Use Server.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Server.UnsetOption to restore inheritance or the global default.

func (Server) SetCopyCommand

func (s Server) SetCopyCommand(ctx context.Context, value string) error

SetCopyCommand stores the "copy-command" server option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with ServerOptionValues.CopyCommand from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetDefaultClientCommand

func (s Server) SetDefaultClientCommand(ctx context.Context, value string) error

SetDefaultClientCommand stores the "default-client-command" server option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with ServerOptionValues.DefaultClientCommand from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetDefaultTerminal

func (s Server) SetDefaultTerminal(ctx context.Context, value string) error

SetDefaultTerminal stores the "default-terminal" server option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with ServerOptionValues.DefaultTerminal from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetEditor

func (s Server) SetEditor(ctx context.Context, value string) error

SetEditor stores the "editor" server option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with ServerOptionValues.Editor from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetEnvironment

func (s Server) SetEnvironment(
	ctx context.Context,
	name string,
	value string,
	options SetEnvironmentOptions,
) error

SetEnvironment stores a value in the server's global tmux environment. ExpandFormat and Hidden select tmux flags; cancellation does not prove the value was not stored.

func (Server) SetEscapeTime

func (s Server) SetEscapeTime(ctx context.Context, value int64) error

SetEscapeTime stores the "escape-time" server option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with ServerOptionValues.EscapeTime from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetExitEmpty

func (s Server) SetExitEmpty(ctx context.Context, value bool) error

SetExitEmpty stores the "exit-empty" server option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with ServerOptionValues.ExitEmpty from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetExitUnattached

func (s Server) SetExitUnattached(ctx context.Context, value bool) error

SetExitUnattached stores the "exit-unattached" server option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with ServerOptionValues.ExitUnattached from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetExtendedKeys

func (s Server) SetExtendedKeys(ctx context.Context, value ExtendedKeys) error

SetExtendedKeys stores the "extended-keys" server option, available since tmux 3.2a. It accepts ExtendedKeys and does not expose raw set-option flags. Read it back with ServerOptionValues.ExtendedKeys from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetExtendedKeysFormat

func (s Server) SetExtendedKeysFormat(ctx context.Context, value ExtendedKeysFormat) error

SetExtendedKeysFormat stores the "extended-keys-format" server option, available since tmux 3.5. It accepts ExtendedKeysFormat and does not expose raw set-option flags. Read it back with ServerOptionValues.ExtendedKeysFormat from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetFocusEvents

func (s Server) SetFocusEvents(ctx context.Context, value bool) error

SetFocusEvents stores the "focus-events" server option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with ServerOptionValues.FocusEvents from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetGetClipboard

func (s Server) SetGetClipboard(ctx context.Context, value GetClipboard) error

SetGetClipboard stores the "get-clipboard" server option, available since tmux 3.7. It accepts GetClipboard and does not expose raw set-option flags. Read it back with ServerOptionValues.GetClipboard from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetHistoryFile

func (s Server) SetHistoryFile(ctx context.Context, value string) error

SetHistoryFile stores the "history-file" server option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with ServerOptionValues.HistoryFile from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetInputBufferSize

func (s Server) SetInputBufferSize(ctx context.Context, value int64) error

SetInputBufferSize stores the "input-buffer-size" server option, available since tmux 3.6. It accepts int64 and does not expose raw set-option flags. Read it back with ServerOptionValues.InputBufferSize from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetMessageLimit

func (s Server) SetMessageLimit(ctx context.Context, value int64) error

SetMessageLimit stores the "message-limit" server option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with ServerOptionValues.MessageLimit from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetOption

func (s Server) SetOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

SetOption stores a server-scope option without refreshing existing models. It may validate a known option against the live version. Completed failures return secret-safe option errors; cancellation does not prove the mutation was not accepted by tmux.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-set-option",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// SetOption takes any tmux option name, including one outside the generated
	// catalog. The empty options value states that no mutation flag applies.
	if err := server.SetOption(ctx, "exit-empty", "off", tmux.SetOptionOptions{}); err != nil {
		fmt.Println("set option:", err)
		return
	}
	value, ok, err := server.RawOption(ctx, "exit-empty")
	fmt.Println(value, ok, err)
}
Output:
off true <nil>

func (Server) SetPrefixTimeout

func (s Server) SetPrefixTimeout(ctx context.Context, value int64) error

SetPrefixTimeout stores the "prefix-timeout" server option, available since tmux 3.5. It accepts int64 and does not expose raw set-option flags. Read it back with ServerOptionValues.PrefixTimeout from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetPromptHistoryLimit

func (s Server) SetPromptHistoryLimit(ctx context.Context, value int64) error

SetPromptHistoryLimit stores the "prompt-history-limit" server option, available since tmux 3.3. It accepts int64 and does not expose raw set-option flags. Read it back with ServerOptionValues.PromptHistoryLimit from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) SetTerminalFeatures

func (s Server) SetTerminalFeatures(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetTerminalFeatures performs a complete replacement of the "terminal-features" server option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with ServerOptionValues.TerminalFeatures from Server.Options. Use Server.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Server.UnsetOption to restore inheritance or the global default.

func (Server) SetTerminalOverrides

func (s Server) SetTerminalOverrides(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetTerminalOverrides performs a complete replacement of the "terminal-overrides" server option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with ServerOptionValues.TerminalOverrides from Server.Options. Use Server.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Server.UnsetOption to restore inheritance or the global default.

func (Server) SetUserKeys

func (s Server) SetUserKeys(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetUserKeys performs a complete replacement of the "user-keys" server option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with ServerOptionValues.UserKeys from Server.Options. Use Server.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Server.UnsetOption to restore inheritance or the global default.

func (Server) SetVariationSelectorAlwaysWide

func (s Server) SetVariationSelectorAlwaysWide(ctx context.Context, value bool) error

SetVariationSelectorAlwaysWide stores the "variation-selector-always-wide" server option, available since tmux 3.6. It accepts bool and does not expose raw set-option flags. Read it back with ServerOptionValues.VariationSelectorAlwaysWide from Server.Options, and Server.UnsetOption restores inheritance or the global default. Use Server.SetOption for caller-named options or raw values.

func (Server) ShowBuffer

func (s Server) ShowBuffer(ctx context.Context, name *string) (string, error)

ShowBuffer returns one buffer using Python-compatible line reconstruction. The returned string is owned by the caller; nil Name selects tmux's most recent buffer. Completed stderr is an error.

func (Server) ShowBufferBytes

func (s Server) ShowBufferBytes(ctx context.Context, name *string) ([]byte, error)

ShowBufferBytes returns one buffer as exact caller-owned tmux stdout bytes. Unlike Server.ShowBuffer, it preserves invalid UTF-8, delimiters, and trailing newlines. Nil Name selects tmux's most recent buffer. Completed stderr returns a redacted command error and a nil byte slice.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-show-buffer",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}
	name := "clipboard"
	if err := server.SetBuffer(ctx, tmux.SetBufferRequest{
		Name: &name, Data: "copied text",
	}); err != nil {
		fmt.Println("set buffer:", err)
		return
	}

	// A buffer holds whatever was copied into it, which need not be text, so
	// the bytes accessor returns it undecoded.
	output, err := server.ShowBufferBytes(ctx, &name)
	if err != nil {
		fmt.Println("show buffer:", err)
		return
	}
	fmt.Printf("%q\n", output)
}
Output:
"copied text"

func (Server) ShowEnvironment

func (s Server) ShowEnvironment(ctx context.Context) (map[string]EnvironmentValue, error)

ShowEnvironment returns an owned server-global non-hidden tmux environment. Completed command failures return an empty map unless strict errors are enabled. Externally injected multiline entries return ErrMalformedEnvironment because tmux's multi-entry output does not frame continuation lines. Decode errors are compatible with ErrMalformedEnvironment and return no partial map.

func (Server) ShowMessages

func (s Server) ShowMessages(
	ctx context.Context,
	request ShowMessagesRequest,
) ([]string, error)

ShowMessages returns an owned snapshot of the tmux message log, terminal capabilities, job summary, or both terminal and job summaries. A zero TargetClient selects tmux's current client; a list failure is returned rather than answered with no rows.

func (Server) ShowPromptHistory

func (s Server) ShowPromptHistory(
	ctx context.Context,
	request PromptHistoryRequest,
) ([]string, error)

ShowPromptHistory returns an owned snapshot of tmux prompt-history lines. It requires tmux 3.3 or later and returns VersionTooLowError below that floor. A tmux command or transport failure is returned rather than answered with no history.

func (Server) Snapshot

func (s Server) Snapshot(ctx context.Context) (Snapshot, error)

Snapshot materializes sessions, winlinks, panes, and clients. Its commands run sequentially, so the result is observational rather than an atomic tmux transaction. A tmux command or transport failure is returned rather than answered with an empty snapshot, and ErrNoServer classifies a server that was not reached; context, decode, version, and identity-change failures are errors of their own. Canceling ctx stops the current tmux command wait; earlier listings may already have completed.

The result is proven to describe one tmux server. A server that exits and is replaced on the same socket mid-read would otherwise be reported as a single coherent state assembled from two, so the server's identity is read around the listing and a change between them is an error rather than a result. That costs a tmux command on each side of the listing, which is what a read of this shape spends beyond the listing itself. A transport implementing InstanceBoundEngine proves the same thing by staying connected, so it skips the closing read. The opening one stays: it reports the server's version as well as its identity, and the listing formats are chosen from that.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-snapshot",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// A snapshot reads the whole server once. Every record it holds carries its
	// relations, so walking the hierarchy afterwards runs no further command
	// and cannot see the server change underneath it.
	snapshot, err := server.Snapshot(ctx)
	if err != nil {
		fmt.Println("snapshot:", err)
		return
	}
	for _, session := range snapshot.Sessions() {
		name, _ := session.Name()
		panes, _ := session.Panes()
		fmt.Println(name, len(panes))
	}
	fmt.Println(len(snapshot.Windows()), len(snapshot.Panes()))
}
Output:
build 1
1 1

func (Server) SocketPath

func (s Server) SocketPath() string

SocketPath returns the configured explicit tmux socket path.

func (Server) SourceFile

func (s Server) SourceFile(ctx context.Context, request SourceFileRequest) error

SourceFile loads or parses one tmux configuration file. The path expands ~ and ~/... for the current user and normalizes redundant separators and dot components without collapsing parent components. Named-user forms are rejected. Exact "-" is rejected because it requires process stdin; a relative path naming a file called "-" remains file data. It can mutate tmux configuration; completed stderr is an error, and cancellation does not prove that parsing or sourcing did not occur.

func (Server) Start

func (s Server) Start(ctx context.Context) error

Start starts the configured tmux server. It is idempotent when that server is already running. Completed stderr is an error; cancellation does not prove that a daemon was not started.

tmux's exit-empty default ends a server that holds no sessions, so a server started with nothing in it can be gone before the next command reaches it, and Start still reports success. Create a session to keep one running, or turn exit-empty off in ServerOptions.ConfigFile, which tmux reads as the server starts. It cannot be turned off by a later command, because that command needs the server the setting exists to keep alive. A later command against a server that has already exited reports the failing tmux command rather than the missing server; use Server.IsAlive or Server.RaiseIfDead to ask directly.

func (Server) String

func (s Server) String() string

String returns a concise representation of the server selector.

func (Server) SubprocessEngine

func (s Server) SubprocessEngine() Engine

SubprocessEngine returns the Engine that runs every request as its own tmux process, through this server's configured ServerOptions.Runner. It is what a handle with no engine already does, as a value: passing it to Server.WithEngine restores process execution on a handle derived from one that selected another engine.

It is also how a caller declines a connection a library would otherwise open for them. A handle carrying this engine has chosen its transport, and code that checks Server.Engine leaves that choice alone, so it is the way to say no to something that would attach a tmux client.

func (Server) SuspendClient

func (s Server) SuspendClient(ctx context.Context, targetClient *ClientName) error

SuspendClient suspends a client, or tmux's current client when targetClient is nil. Cancellation does not prove suspension did not occur.

func (Server) SwitchClient

func (s Server) SwitchClient(ctx context.Context, targetSession string) error

SwitchClient switches tmux's current client to targetSession. TargetSession is a validated session name rather than a stable identity; cancellation does not prove the switch did not occur.

func (Server) UnbindKey

func (s Server) UnbindKey(ctx context.Context, request UnbindKeyRequest) error

UnbindKey removes one key binding or every binding in a key table. Key and AllKeys must select exactly one target; cancellation does not prove removal did not occur.

func (Server) UnsetEnvironment

func (s Server) UnsetEnvironment(ctx context.Context, name string) error

UnsetEnvironment deletes a value from the server's global tmux environment. Cancellation does not prove deletion did not occur.

func (Server) UnsetOption

func (s Server) UnsetOption(
	ctx context.Context,
	name string,
	options UnsetOptionOptions,
) error

UnsetOption unsets a server-scope option without refreshing existing models. UnsetPanes is invalid at server scope. Completed failures are secret-safe option errors; cancellation does not prove the unset was not accepted.

func (Server) Version

func (s Server) Version(ctx context.Context) (Version, error)

Version returns the configured tmux binary's cached version. Failed probes are not cached. A waiting caller can abandon an in-flight shared probe when ctx ends without canceling the caller that owns the probe.

func (Server) WaitFor

func (s Server) WaitFor(ctx context.Context, request WaitForRequest) error

WaitFor waits for, signals, locks, or unlocks a named tmux channel. It changes only that server-side channel state; cancellation can interrupt the client wait but cannot prove a preceding signal or lock did not take effect.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-wait-for",
	})
	defer killExampleServer(server)

	if _, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"}); err != nil {
		fmt.Println("create session:", err)
		return
	}

	// WaitFor is tmux's wait-for channel between commands, not a way to wait
	// for a pane's output. A waiter blocks until something signals the channel,
	// so signal it from another goroutine.
	go func() {
		signalCtx, signalCancel := context.WithTimeout(context.Background(), 10*time.Second)
		defer signalCancel()
		_ = server.WaitFor(signalCtx, tmux.WaitForRequest{
			Channel: "ready",
			Mode:    tmux.WaitForModeSignal,
		})
	}()

	if err := server.WaitFor(ctx, tmux.WaitForRequest{Channel: "ready"}); err != nil {
		fmt.Println("wait:", err)
		return
	}
	fmt.Println("signalled")
}
Output:
signalled
Example (PaneCompletion)

ExampleServer_WaitFor_paneCompletion gates on a pane command finishing without reading the pane at all, which no echo can defeat.

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	socket := "libtmux-go-example-wait-for-pane"
	server := tmux.NewServer(tmux.ServerOptions{SocketName: socket})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	pane, ok, err := session.ResolveActivePane(ctx)
	if err != nil || !ok {
		fmt.Println("resolve pane:", ok, err)
		return
	}

	// The command signals the channel itself, so the wait ends when the work
	// ends rather than when a matching line happens to reach the screen.
	command := "printf 'building\n'; tmux -L " + socket + " wait-for -S built"
	if err := pane.SendKeys(ctx, tmux.SendKeysRequest{Command: &command}); err != nil {
		fmt.Println("send keys:", err)
		return
	}
	if err := server.WaitFor(ctx, tmux.WaitForRequest{Channel: "built"}); err != nil {
		fmt.Println("wait:", err)
		return
	}
	fmt.Println("build finished")
}
Output:
build finished

func (Server) Window

func (s Server) Window(ctx context.Context, id WindowID) (Window, error)

Window performs a canonical live lookup of id using tmux's canonical session and returns a newly materialized record. It does not preserve a linked-session view; use Window.ResolveSession for that exact relationship. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-window-lookup",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{
		Name: "build", WindowName: "editor",
	})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	created, err := session.ResolveActiveWindow(ctx)
	if err != nil {
		fmt.Println("resolve window:", err)
		return
	}

	window, err := server.Window(ctx, created.ID())
	if err != nil {
		fmt.Println("look up window:", err)
		return
	}
	name, _ := window.Name()
	fmt.Println(name)
}
Output:
editor

func (Server) Windows

func (s Server) Windows(ctx context.Context) ([]Window, error)

Windows materializes one window record per winlink. A tmux command or transport failure is returned rather than answered with no rows, so an empty result means the server held nothing; ErrNoServer classifies a server that was not reached. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Server) WithEngine

func (s Server) WithEngine(engine Engine) Server

WithEngine returns a handle whose supported commands run through engine rather than through a tmux process. A nil engine restores process execution. The returned handle shares immutable configuration and version-cache coordination with s; derived sessions, windows, and panes keep the engine.

The engine is not adopted: s keeps forking, and closing the engine's transport is the caller's job. Operations the engine does not support, and the reads that promise tmux's exact stdout bytes, keep running as tmux processes on the returned handle.

A record carries the handle that produced it, so sessions, windows, and panes obtained before this call keep forking and report no error while doing so. Look one up again through the returned handle, with Server.Session, Server.Window, or Server.Pane, to move it onto the engine.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-with-engine",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	// A control-mode client is one persistent tmux process. Selecting its
	// engine makes the operations below reuse that connection instead of
	// starting a tmux process each.
	client, err := server.OpenControl(ctx, session)
	if err != nil {
		fmt.Println("open control:", err)
		return
	}
	defer func() { _ = client.Close() }()
	connected := server.WithEngine(client.Engine())

	window, err := connected.Session(ctx, session.ID())
	if err != nil {
		fmt.Println("look up session:", err)
		return
	}
	name, _ := window.Name()
	fmt.Println(name)
}
Output:
build

type ServerAccessRequest

type ServerAccessRequest struct {
	// Allow grants the named user access.
	Allow *string
	// Deny revokes the named user's access.
	Deny *string
	// List returns the configured access entries instead of mutating them.
	List bool
	// ReadOnly grants read-only access to the selected user.
	ReadOnly bool
	// Write grants write access to the selected user.
	Write bool
}

ServerAccessRequest configures tmux server access control. Its zero value is invalid: List or exactly one nonempty Allow or Deny is required. Allow and Deny, and ReadOnly and Write, are mutually exclusive; nil pointers omit their selectors while explicit empty users are rejected. List selects the returned-list path, but compatible selector and mode flags are still sent to tmux rather than ignored.

type ServerCommandRequestError

type ServerCommandRequestError struct {
	// Subcommand is the tmux command whose request was rejected.
	Subcommand string
	// Field is the request field that was rejected.
	Field string
	// Value is the rejected value, or "[redacted]" for a secret-sensitive field.
	Value string
	// Reason describes the validation failure without changing the sentinel error.
	Reason string
}

ServerCommandRequestError reports a locally rejected server command request field. Callers can use errors.Is with ErrInvalidServerCommandRequest or errors.As to inspect it. Value is redacted only when that field's validator requests redaction.

func (*ServerCommandRequestError) Error

func (e *ServerCommandRequestError) Error() string

Error implements error.

func (*ServerCommandRequestError) Unwrap

func (e *ServerCommandRequestError) Unwrap() error

Unwrap makes ServerCommandRequestError compatible with ErrInvalidServerCommandRequest.

type ServerHookValues

type ServerHookValues struct {
	// contains filtered or unexported fields
}

ServerHookValues is an immutable point-in-time view of known global session-scope hook values. Its zero value has no present values. Obtain it with GlobalSessionScope.Hooks; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (ServerHookValues) AfterBindKey

func (v ServerHookValues) AfterBindKey() OptionValue[SparseArray[string]]

AfterBindKey returns the "after-bind-key" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterCapturePane

func (v ServerHookValues) AfterCapturePane() OptionValue[SparseArray[string]]

AfterCapturePane returns the "after-capture-pane" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterCopyMode

func (v ServerHookValues) AfterCopyMode() OptionValue[SparseArray[string]]

AfterCopyMode returns the "after-copy-mode" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterDisplayMessage

func (v ServerHookValues) AfterDisplayMessage() OptionValue[SparseArray[string]]

AfterDisplayMessage returns the "after-display-message" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterDisplayPanes

func (v ServerHookValues) AfterDisplayPanes() OptionValue[SparseArray[string]]

AfterDisplayPanes returns the "after-display-panes" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterKillPane

func (v ServerHookValues) AfterKillPane() OptionValue[SparseArray[string]]

AfterKillPane returns the "after-kill-pane" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterListBuffers

func (v ServerHookValues) AfterListBuffers() OptionValue[SparseArray[string]]

AfterListBuffers returns the "after-list-buffers" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterListClients

func (v ServerHookValues) AfterListClients() OptionValue[SparseArray[string]]

AfterListClients returns the "after-list-clients" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterListKeys

func (v ServerHookValues) AfterListKeys() OptionValue[SparseArray[string]]

AfterListKeys returns the "after-list-keys" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterListPanes

func (v ServerHookValues) AfterListPanes() OptionValue[SparseArray[string]]

AfterListPanes returns the "after-list-panes" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterListSessions

func (v ServerHookValues) AfterListSessions() OptionValue[SparseArray[string]]

AfterListSessions returns the "after-list-sessions" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterListWindows

func (v ServerHookValues) AfterListWindows() OptionValue[SparseArray[string]]

AfterListWindows returns the "after-list-windows" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterLoadBuffer

func (v ServerHookValues) AfterLoadBuffer() OptionValue[SparseArray[string]]

AfterLoadBuffer returns the "after-load-buffer" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterLockServer

func (v ServerHookValues) AfterLockServer() OptionValue[SparseArray[string]]

AfterLockServer returns the "after-lock-server" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterNewSession

func (v ServerHookValues) AfterNewSession() OptionValue[SparseArray[string]]

AfterNewSession returns the "after-new-session" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterNewWindow

func (v ServerHookValues) AfterNewWindow() OptionValue[SparseArray[string]]

AfterNewWindow returns the "after-new-window" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterPasteBuffer

func (v ServerHookValues) AfterPasteBuffer() OptionValue[SparseArray[string]]

AfterPasteBuffer returns the "after-paste-buffer" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterPipePane

func (v ServerHookValues) AfterPipePane() OptionValue[SparseArray[string]]

AfterPipePane returns the "after-pipe-pane" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterQueue

AfterQueue returns the "after-queue" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterRefreshClient

func (v ServerHookValues) AfterRefreshClient() OptionValue[SparseArray[string]]

AfterRefreshClient returns the "after-refresh-client" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterRenameSession

func (v ServerHookValues) AfterRenameSession() OptionValue[SparseArray[string]]

AfterRenameSession returns the "after-rename-session" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterRenameWindow

func (v ServerHookValues) AfterRenameWindow() OptionValue[SparseArray[string]]

AfterRenameWindow returns the "after-rename-window" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterResizePane

func (v ServerHookValues) AfterResizePane() OptionValue[SparseArray[string]]

AfterResizePane returns the "after-resize-pane" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterResizeWindow

func (v ServerHookValues) AfterResizeWindow() OptionValue[SparseArray[string]]

AfterResizeWindow returns the "after-resize-window" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSaveBuffer

func (v ServerHookValues) AfterSaveBuffer() OptionValue[SparseArray[string]]

AfterSaveBuffer returns the "after-save-buffer" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSelectLayout

func (v ServerHookValues) AfterSelectLayout() OptionValue[SparseArray[string]]

AfterSelectLayout returns the "after-select-layout" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSelectPane

func (v ServerHookValues) AfterSelectPane() OptionValue[SparseArray[string]]

AfterSelectPane returns the "after-select-pane" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSelectWindow

func (v ServerHookValues) AfterSelectWindow() OptionValue[SparseArray[string]]

AfterSelectWindow returns the "after-select-window" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSendKeys

func (v ServerHookValues) AfterSendKeys() OptionValue[SparseArray[string]]

AfterSendKeys returns the "after-send-keys" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSetBuffer

func (v ServerHookValues) AfterSetBuffer() OptionValue[SparseArray[string]]

AfterSetBuffer returns the "after-set-buffer" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSetEnvironment

func (v ServerHookValues) AfterSetEnvironment() OptionValue[SparseArray[string]]

AfterSetEnvironment returns the "after-set-environment" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSetHook

func (v ServerHookValues) AfterSetHook() OptionValue[SparseArray[string]]

AfterSetHook returns the "after-set-hook" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSetOption

func (v ServerHookValues) AfterSetOption() OptionValue[SparseArray[string]]

AfterSetOption returns the "after-set-option" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterShowEnvironment

func (v ServerHookValues) AfterShowEnvironment() OptionValue[SparseArray[string]]

AfterShowEnvironment returns the "after-show-environment" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterShowMessages

func (v ServerHookValues) AfterShowMessages() OptionValue[SparseArray[string]]

AfterShowMessages returns the "after-show-messages" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterShowOptions

func (v ServerHookValues) AfterShowOptions() OptionValue[SparseArray[string]]

AfterShowOptions returns the "after-show-options" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterSplitWindow

func (v ServerHookValues) AfterSplitWindow() OptionValue[SparseArray[string]]

AfterSplitWindow returns the "after-split-window" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AfterUnbindKey

func (v ServerHookValues) AfterUnbindKey() OptionValue[SparseArray[string]]

AfterUnbindKey returns the "after-unbind-key" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AlertActivity

func (v ServerHookValues) AlertActivity() OptionValue[SparseArray[string]]

AlertActivity returns the "alert-activity" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AlertBell

AlertBell returns the "alert-bell" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) AlertSilence

func (v ServerHookValues) AlertSilence() OptionValue[SparseArray[string]]

AlertSilence returns the "alert-silence" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientActive

func (v ServerHookValues) ClientActive() OptionValue[SparseArray[string]]

ClientActive returns the "client-active" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientAttached

func (v ServerHookValues) ClientAttached() OptionValue[SparseArray[string]]

ClientAttached returns the "client-attached" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientDarkTheme

func (v ServerHookValues) ClientDarkTheme() OptionValue[SparseArray[string]]

ClientDarkTheme returns the "client-dark-theme" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.6. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientDetached

func (v ServerHookValues) ClientDetached() OptionValue[SparseArray[string]]

ClientDetached returns the "client-detached" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientFocusIn

func (v ServerHookValues) ClientFocusIn() OptionValue[SparseArray[string]]

ClientFocusIn returns the "client-focus-in" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientFocusOut

func (v ServerHookValues) ClientFocusOut() OptionValue[SparseArray[string]]

ClientFocusOut returns the "client-focus-out" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientLightTheme

func (v ServerHookValues) ClientLightTheme() OptionValue[SparseArray[string]]

ClientLightTheme returns the "client-light-theme" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.6. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientResized

func (v ServerHookValues) ClientResized() OptionValue[SparseArray[string]]

ClientResized returns the "client-resized" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) ClientSessionChanged

func (v ServerHookValues) ClientSessionChanged() OptionValue[SparseArray[string]]

ClientSessionChanged returns the "client-session-changed" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) CommandError

func (v ServerHookValues) CommandError() OptionValue[SparseArray[string]]

CommandError returns the "command-error" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.5. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) SessionClosed

func (v ServerHookValues) SessionClosed() OptionValue[SparseArray[string]]

SessionClosed returns the "session-closed" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) SessionCreated

func (v ServerHookValues) SessionCreated() OptionValue[SparseArray[string]]

SessionCreated returns the "session-created" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) SessionRenamed

func (v ServerHookValues) SessionRenamed() OptionValue[SparseArray[string]]

SessionRenamed returns the "session-renamed" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) SessionWindowChanged

func (v ServerHookValues) SessionWindowChanged() OptionValue[SparseArray[string]]

SessionWindowChanged returns the "session-window-changed" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) WindowLinked

func (v ServerHookValues) WindowLinked() OptionValue[SparseArray[string]]

WindowLinked returns the "window-linked" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerHookValues) WindowUnlinked

func (v ServerHookValues) WindowUnlinked() OptionValue[SparseArray[string]]

WindowUnlinked returns the "window-unlinked" global session-scope hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use GlobalSessionScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

type ServerOptionValues

type ServerOptionValues struct {
	// contains filtered or unexported fields
}

ServerOptionValues is an immutable point-in-time view of known server option values. Its zero value has no present values. Obtain it with Server.Options; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (ServerOptionValues) Backspace

func (v ServerOptionValues) Backspace() OptionValue[string]

Backspace returns the "backspace" server option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are KEY since tmux 3.2a. Set it with Server.SetBackspace. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) BufferLimit

func (v ServerOptionValues) BufferLimit() OptionValue[int64]

BufferLimit returns the "buffer-limit" server option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Server.SetBufferLimit. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) CodepointWidths

func (v ServerOptionValues) CodepointWidths() OptionValue[SparseArray[string]]

CodepointWidths returns the "codepoint-widths" server option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Server.SetCodepointWidths. Use Server.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerOptionValues) CommandAlias

func (v ServerOptionValues) CommandAlias() OptionValue[SparseArray[string]]

CommandAlias returns the "command-alias" server option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetCommandAlias. Use Server.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerOptionValues) CommandAliases

func (v ServerOptionValues) CommandAliases() (OptionValue[CommandAliases], error)

CommandAliases parses command-alias while preserving option presence and origin. A nonnil joined error contains ComplexOptionDecodeError values, each usable with errors.Is or errors.As; the returned projection still contains every valid entry and is owned by the caller.

func (ServerOptionValues) CopyCommand

func (v ServerOptionValues) CopyCommand() OptionValue[string]

CopyCommand returns the "copy-command" server option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetCopyCommand. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) DefaultClientCommand

func (v ServerOptionValues) DefaultClientCommand() OptionValue[string]

DefaultClientCommand returns the "default-client-command" server option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.6. Set it with Server.SetDefaultClientCommand. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) DefaultTerminal

func (v ServerOptionValues) DefaultTerminal() OptionValue[string]

DefaultTerminal returns the "default-terminal" server option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetDefaultTerminal. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) Editor

Editor returns the "editor" server option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetEditor. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) EscapeTime

func (v ServerOptionValues) EscapeTime() OptionValue[int64]

EscapeTime returns the "escape-time" server option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Server.SetEscapeTime. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) ExitEmpty

func (v ServerOptionValues) ExitEmpty() OptionValue[bool]

ExitEmpty returns the "exit-empty" server option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Server.SetExitEmpty. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) ExitUnattached

func (v ServerOptionValues) ExitUnattached() OptionValue[bool]

ExitUnattached returns the "exit-unattached" server option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Server.SetExitUnattached. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) ExtendedKeys

func (v ServerOptionValues) ExtendedKeys() OptionValue[ExtendedKeys]

ExtendedKeys returns the "extended-keys" server option value as OptionValue with Go value shape OptionValue[ExtendedKeys]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "always"). Set it with Server.SetExtendedKeys. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) ExtendedKeysFormat

func (v ServerOptionValues) ExtendedKeysFormat() OptionValue[ExtendedKeysFormat]

ExtendedKeysFormat returns the "extended-keys-format" server option value as OptionValue with Go value shape OptionValue[ExtendedKeysFormat]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.5 (choices: "csi-u", "xterm"). Set it with Server.SetExtendedKeysFormat. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) FocusEvents

func (v ServerOptionValues) FocusEvents() OptionValue[bool]

FocusEvents returns the "focus-events" server option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Server.SetFocusEvents. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) GetClipboard

func (v ServerOptionValues) GetClipboard() OptionValue[GetClipboard]

GetClipboard returns the "get-clipboard" server option value as OptionValue with Go value shape OptionValue[GetClipboard]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.7 (choices: "off", "buffer", "request", "both"). Set it with Server.SetGetClipboard. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) HistoryFile

func (v ServerOptionValues) HistoryFile() OptionValue[string]

HistoryFile returns the "history-file" server option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetHistoryFile. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) InputBufferSize

func (v ServerOptionValues) InputBufferSize() OptionValue[int64]

InputBufferSize returns the "input-buffer-size" server option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.6. Set it with Server.SetInputBufferSize. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) MessageLimit

func (v ServerOptionValues) MessageLimit() OptionValue[int64]

MessageLimit returns the "message-limit" server option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Server.SetMessageLimit. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) ParsedTerminalFeatures

func (v ServerOptionValues) ParsedTerminalFeatures() (OptionValue[TerminalFeatures], error)

ParsedTerminalFeatures parses terminal-features while preserving option presence and origin. A nonnil joined error contains ComplexOptionDecodeError values and the returned owned projection contains every valid entry.

func (ServerOptionValues) ParsedTerminalOverrides

func (v ServerOptionValues) ParsedTerminalOverrides() (OptionValue[TerminalOverrides], error)

ParsedTerminalOverrides parses terminal-overrides while preserving option presence and origin. Terminal-overrides syntax is permissive: no malformed entry error is returned, and the result owns its parsed projection.

func (ServerOptionValues) PrefixTimeout

func (v ServerOptionValues) PrefixTimeout() OptionValue[int64]

PrefixTimeout returns the "prefix-timeout" server option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.5. Set it with Server.SetPrefixTimeout. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) PromptHistoryLimit

func (v ServerOptionValues) PromptHistoryLimit() OptionValue[int64]

PromptHistoryLimit returns the "prompt-history-limit" server option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.3. Set it with Server.SetPromptHistoryLimit. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) SetClipboard

func (v ServerOptionValues) SetClipboard() OptionValue[SetClipboard]

SetClipboard returns the "set-clipboard" server option value as OptionValue with Go value shape OptionValue[SetClipboard]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "external", "on"). Set it with Server.SetClipboard. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

func (ServerOptionValues) TerminalFeatures

func (v ServerOptionValues) TerminalFeatures() OptionValue[SparseArray[string]]

TerminalFeatures returns the "terminal-features" server option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetTerminalFeatures. Use Server.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerOptionValues) TerminalOverrides

func (v ServerOptionValues) TerminalOverrides() OptionValue[SparseArray[string]]

TerminalOverrides returns the "terminal-overrides" server option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetTerminalOverrides. Use Server.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerOptionValues) UserKeys

UserKeys returns the "user-keys" server option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Server.SetUserKeys. Use Server.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (ServerOptionValues) VariationSelectorAlwaysWide

func (v ServerOptionValues) VariationSelectorAlwaysWide() OptionValue[bool]

VariationSelectorAlwaysWide returns the "variation-selector-always-wide" server option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.6. Set it with Server.SetVariationSelectorAlwaysWide. Use Server.RawOption for caller-named or undecoded values. It is not a style option.

type ServerOptions

type ServerOptions struct {
	// Binary is the tmux executable name or path. Empty resolves tmux through
	// PATH for each invocation. A binary that cannot be resolved fails every
	// operation, as an os/exec.Error. Match it
	// with errors.As rather than errors.Is(err, exec.ErrNotFound), which holds
	// only for a bare name missing from PATH and not for an absent explicit
	// path.
	Binary string
	// SocketName selects tmux's named socket. SocketPath takes precedence.
	SocketName string
	// SocketPath selects an explicit tmux socket path.
	SocketPath string
	// ConfigFile selects an exact tmux configuration file. Empty lets tmux read
	// its default configuration, so a program inherits whatever the user
	// running it has configured: a base-index other than zero, a prompt that
	// appears in captured pane text, hooks that fire on the sessions this
	// program creates. Point it at a file the program owns, which may be an
	// empty one, when the tmux it drives should not depend on that.
	ConfigFile string
	// Colors overrides tmux's terminal color capability.
	Colors ColorMode
	// ProcessEnvironment replaces the child process environment. Nil inherits
	// the current process environment; a non-nil empty slice supplies no
	// caller-provided variables, subject to additions required by Go or the
	// target platform. NewServer clones the slice.
	ProcessEnvironment []string
	// Unsupported selects what happens when a request needs an optional tmux
	// capability the running server does not have. The zero value refuses the
	// request; see UnsupportedPolicy.
	Unsupported UnsupportedPolicy
	// WarningHandler receives nonfatal compatibility warnings. Nil discards
	// warnings. See WarningHandler for delivery and concurrency semantics.
	WarningHandler WarningHandler
	// Runner replaces process execution for tests and alternate transports. Nil
	// uses the local tmux subprocess runner. The server retains Runner, which
	// must support concurrent calls when the server is used concurrently.
	//
	// It covers requests that run to completion and return output. It does not
	// cover the tmux -C process Server.OpenControl starts, which is a
	// long-lived bidirectional stream that a request-and-result interface
	// cannot carry; that process is started directly, while its registration
	// and version probes do pass through Runner. Substituting Runner therefore
	// does not stop OpenControl from starting a real tmux.
	//
	// Because Runner sees every request an engine does not carry, it is also
	// how a caller confirms an engine is being used: count the requests that
	// reach it before and after Server.WithEngine. Wrap SubprocessRunner to do
	// that rather than reimplementing execution, whose result shape the rest
	// of the package reads.
	Runner CommandRunner
}

ServerOptions configures a Server without executing tmux. NewServer copies ProcessEnvironment; callers retain ownership of the supplied slice.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is one materialized tmux session record. It is normally returned by Server.Snapshot, Server.Session, or Session.Refresh. A zero Session is not a usable tmux target.

func SessionFromEnv

func SessionFromEnv(ctx context.Context, environment map[string]string) (Session, error)

SessionFromEnv returns the canonical session containing the environment's pane. Nil reads the process environment; a nonnil empty map does not.

func (Session) Active

func (s Session) Active() (bool, bool)

Active returns a typed bool value and an ok result parsed from tmux #{session_active} in this Session's materialized session-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) ActivePane

func (s Session) ActivePane() (Pane, bool)

ActivePane returns the active pane in this session's materialized active window. It never queries tmux; use Session.ResolveActivePane for live state.

func (Session) ActiveWindow

func (s Session) ActiveWindow() (Window, bool)

ActiveWindow returns this session's sole active winlink from the materialized snapshot. It never queries tmux; use Session.ResolveActiveWindow for live state.

func (Session) ActiveWindowIndex

func (s Session) ActiveWindowIndex() (int, bool)

ActiveWindowIndex returns a typed int value and an ok result parsed from tmux #{active_window_index} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Activity

func (s Session) Activity() (time.Time, bool)

Activity returns a typed time.Time value and an ok result parsed from tmux #{session_activity} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) ActivityFlag

func (s Session) ActivityFlag() (bool, bool)

ActivityFlag returns a typed bool value and an ok result parsed from tmux #{session_activity_flag} in this Session's materialized session-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Alert

func (s Session) Alert() (string, bool)

Alert returns a typed string value and an ok result parsed from tmux #{session_alert} in this Session's materialized session-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Alerts

func (s Session) Alerts() (string, bool)

Alerts returns a typed string value and an ok result parsed from tmux #{session_alerts} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) AppendHook

func (s Session) AppendHook(ctx context.Context, name string, command string) error

AppendHook appends a session hook at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the append.

func (Session) AppendOption

func (s Session) AppendOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

AppendOption appends to a session option at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.

func (Session) Attach

func (s Session) Attach(ctx context.Context, options AttachSessionOptions) error

Attach attaches the caller's terminal to this session's stable identifier and blocks until detach or context cancellation. It validates the receiver's stable SessionID, retains but never closes caller-supplied streams, and returns CommandError for a completed nonzero exit. Cancellation does not prove attachment or detachment did not occur.

func (Session) Attached

func (s Session) Attached() (int, bool)

Attached returns a typed int value and an ok result parsed from tmux #{session_attached} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) AttachedList

func (s Session) AttachedList() (string, bool)

AttachedList returns a typed string value and an ok result parsed from tmux #{session_attached_list} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) BellFlag

func (s Session) BellFlag() (bool, bool)

BellFlag returns a typed bool value and an ok result parsed from tmux #{session_bell_flag} in this Session's materialized session-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Cmd

func (s Session) Cmd(ctx context.Context, args ...string) (CommandResult, error)

Cmd executes a tmux subcommand targeted to the session's stable ID.

func (Session) Created

func (s Session) Created() (time.Time, bool)

Created returns a typed time.Time value and an ok result parsed from tmux #{session_created} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) DetachClients

func (s Session) DetachClients(ctx context.Context, shellCommand *string) error

DetachClients detaches every client attached to the session identified by this handle's stable ID. A nonnil ShellCommand is run after detaching.

func (Session) Equal

func (s Session) Equal(other Session) bool

Equal reports whether two session records carry the same stable ID.

func (Session) Format

func (s Session) Format() (bool, bool)

Format returns a typed bool value and an ok result parsed from tmux #{session_format} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Formats

func (s Session) Formats() FormatValues

Formats returns this Session's read-only materialized tmux format values. It does not query tmux; use Server.Snapshot to obtain a fresh record.

func (Session) GetEnvironment

func (s Session) GetEnvironment(
	ctx context.Context,
	name string,
) (EnvironmentValue, bool, error)

GetEnvironment returns one non-hidden session environment entry for this stable session target. A missing or hidden variable reports ok false.

func (Session) Group

func (s Session) Group() (string, bool)

Group returns a typed string value and an ok result parsed from tmux #{session_group} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) GroupAttached

func (s Session) GroupAttached() (int, bool)

GroupAttached returns a typed int value and an ok result parsed from tmux #{session_group_attached} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) GroupAttachedList

func (s Session) GroupAttachedList() (string, bool)

GroupAttachedList returns a typed string value and an ok result parsed from tmux #{session_group_attached_list} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) GroupList

func (s Session) GroupList() (string, bool)

GroupList returns a typed string value and an ok result parsed from tmux #{session_group_list} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) GroupManyAttached

func (s Session) GroupManyAttached() (bool, bool)

GroupManyAttached returns a typed bool value and an ok result parsed from tmux #{session_group_many_attached} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) GroupSize

func (s Session) GroupSize() (int, bool)

GroupSize returns a typed int value and an ok result parsed from tmux #{session_group_size} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Grouped

func (s Session) Grouped() (bool, bool)

Grouped returns a typed bool value and an ok result parsed from tmux #{session_grouped} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Hooks

func (s Session) Hooks(ctx context.Context) (SessionHookValues, error)

Hooks returns a freshly decoded, caller-owned view of known hooks at this stable session target, including inherited values. A read failure is returned rather than answered with zero values.

func (Session) ID

func (s Session) ID() SessionID

ID returns the stable tmux identity of this session.

func (Session) Kill

func (s Session) Kill(ctx context.Context) error

Kill destroys the receiver session, removes its winlinks, and detaches every client attached to it. A window with no remaining links and all of that window's panes are also destroyed. The materialized receiver is not refreshed and no longer represents a live session. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted. Kill is equivalent to Session.KillWith with a zero SessionKillRequest.

func (Session) KillWindow

func (s Session) KillWindow(ctx context.Context, request KillWindowRequest) error

KillWindow destroys one stable window. When Target and Index are nil it selects the receiver session's current window, and Index selects a winlink in that session. A nonnil Target is forwarded as unrestricted tmux target syntax and may select a window in another session. The selected stable window is removed from every session and its panes are destroyed. Affected sessions preserve their current selection unless this window was current, in which case they select another. A session left without windows is destroyed and its clients are detached.

Target and Index are rejected together before execution. The materialized receiver is not refreshed. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Session) KillWith

func (s Session) KillWith(ctx context.Context, request SessionKillRequest) error

KillWith applies one kill-session mode without refreshing the materialized receiver. The zero request destroys the receiver; AllExcept destroys every other session while preserving the receiver and its current window; ClearAlerts only clears alerts in windows linked to the receiver and leaves sessions, winlinks, panes, client attachments, and current-window selections unchanged. Destroying a session detaches its clients and removes its winlinks; windows left without links and their panes are also destroyed. Group destroys the receiver's group on tmux 3.7 or later. On older versions, Group synchronously reaches WarningHandler, is omitted, and the receiver alone is destroyed.

AllExcept, ClearAlerts, and Group are rejected as mutually exclusive before execution. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Session) LastAttached

func (s Session) LastAttached() (time.Time, bool)

LastAttached returns a typed time.Time value and an ok result parsed from tmux #{session_last_attached} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) LastWindow

func (s Session) LastWindow(ctx context.Context) (Window, error)

LastWindow makes the receiver session's previously selected winlink current and returns that freshly materialized session-specific Window. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window because this navigation operation cannot identify the selected view reliably without refresh.

func (Session) LastWindowIndex

func (s Session) LastWindowIndex() (int, bool)

LastWindowIndex returns a typed int value and an ok result parsed from tmux #{last_window_index} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Lock

func (s Session) Lock(ctx context.Context) error

Lock locks every client attached to the session identified by this handle's stable ID. Cancellation does not prove that tmux did not lock a client.

func (Session) ManyAttached

func (s Session) ManyAttached() (bool, bool)

ManyAttached returns a typed bool value and an ok result parsed from tmux #{session_many_attached} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Marked

func (s Session) Marked() (bool, bool)

Marked returns a typed bool value and an ok result parsed from tmux #{session_marked} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Name

func (s Session) Name() (string, bool)

Name returns a typed string value and an ok result parsed from tmux #{session_name} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) NewWindow

func (s Session) NewWindow(ctx context.Context, request NewWindowRequest) (Window, error)

NewWindow creates a winlink in the receiver session. Attach selects it as that session's current window; it is not a guarantee about clients attached to other sessions. The returned Window is freshly materialized in the receiver's exact session context, including when its stable WindowID is linked elsewhere.

SelectExisting no-output recovery is available only when Index is nil. It expands Name with tmux's version-specific rules and requires exactly one matching window name in the receiver session. An explicit Index has no such recovery. A transport or context error can be delivery-ambiguous and no rollback is attempted. If tmux printed a valid WindowID before that error, or exact refresh fails after creation, NewWindow returns a partial Window containing the receiver SessionID and new WindowID with an Index of -1; other failures return a zero Window. See ErrInvalidCommandOutput and CommandError.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-new-window",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	// Name is a pointer because a nonnil empty string is an explicit -n operand,
	// while nil lets tmux apply automatic-rename.
	windowName := "editor"
	window, err := session.NewWindow(ctx, tmux.NewWindowRequest{Name: &windowName})
	if err != nil {
		fmt.Println("create window:", err)
		return
	}

	name, ok := window.Name()
	fmt.Println(name, ok)
}
Output:
editor true

func (Session) NextWindow

func (s Session) NextWindow(ctx context.Context) (Window, error)

NextWindow makes the next winlink current in the receiver session and returns that freshly materialized session-specific Window. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window.

func (Session) Options

func (s Session) Options(ctx context.Context) (SessionOptionValues, error)

Options returns a freshly decoded, caller-owned view of known options at this stable session target, including inherited values. A read failure is returned rather than answered with zero values; context errors propagate. Each returned accessor names the setter that writes it, so SessionOptionValues.Mouse pairs with Session.SetMouse.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-session-options",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	if err := session.SetMouse(ctx, true); err != nil {
		fmt.Println("set mouse:", err)
		return
	}

	options, err := session.Options(ctx)
	if err != nil {
		fmt.Println("read options:", err)
		return
	}

	// Origin separates a value set at this scope from one reaching it from a
	// parent, which is the difference between configured here and merely in
	// effect here.
	mouse, present := options.Mouse().Get()
	mouseOrigin, _ := options.Mouse().Origin()
	fmt.Println(mouse, present, mouseOrigin)

	// base-index was never set on this session, so it reaches it from the
	// global scope. What it holds depends on the configuration tmux loaded;
	// where it came from does not.
	baseOrigin, _ := options.BaseIndex().Origin()
	fmt.Println(baseOrigin)
}
Output:
true true local
inherited

func (Session) Panes

func (s Session) Panes() ([]Pane, bool)

Panes returns newly allocated shallow copies of this snapshot record's pane views, and reports whether the receiver carries relations at all.

It never queries tmux. Server.Snapshot and the resolvers carry relations; a targeted point lookup, Session.Refresh, and Server.NewSession do not, and report false rather than no panes. Use Session.SearchPanes with a nil filter for the session's current panes.

func (Session) Path

func (s Session) Path() (string, bool)

Path returns a typed string value and an ok result parsed from tmux #{session_path} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) PreviousWindow

func (s Session) PreviousWindow(ctx context.Context) (Window, error)

PreviousWindow makes the previous winlink current in the receiver session and returns that freshly materialized session-specific Window. The selection is session-scoped; it does not promise focus for clients attached to other sessions. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window.

func (Session) RawHook

func (s Session) RawHook(ctx context.Context, name string) (string, bool, error)

RawHook returns one exact session hook value at this stable session target. A successful string is caller-owned; ok reports presence and completed failures are returned. An unindexed empty hook array is ambiguous; use Hooks for typed presence.

func (Session) RawOption

func (s Session) RawOption(ctx context.Context, name string) (string, bool, error)

RawOption returns one exact session option value at this stable session target. A successful string is caller-owned; ok reports presence, and a completed failure is returned rather than normalized. An unindexed empty array is indistinguishable from an empty scalar; use Options for typed array presence.

func (Session) Ref

func (s Session) Ref() Ref

Ref returns a Ref addressing the receiver.

func (Session) Refresh

func (s Session) Refresh(ctx context.Context) (Session, error)

Refresh performs a canonical live lookup for the session's stable ID and returns a new record without mutating the receiver. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Session) RemoveEnvironment

func (s Session) RemoveEnvironment(ctx context.Context, name string) error

RemoveEnvironment marks a variable for removal from new process environments for this stable session target.

func (Session) Rename

func (s Session) Rename(ctx context.Context, name string) (Session, error)

Rename changes the receiver session's name and returns a canonical freshly materialized Session. If the command succeeds but refresh fails, it returns the receiver with that error. A transport or context error can be delivery-ambiguous; no rollback is attempted. Invalid names are rejected before execution and match ErrInvalidRequest.

func (Session) ResolveActivePane

func (s Session) ResolveActivePane(ctx context.Context) (Pane, bool, error)

ResolveActivePane snapshots live tmux state and returns the active pane in this session's exact active window. A missing active pane returns ok false. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Session) ResolveActiveWindow

func (s Session) ResolveActiveWindow(ctx context.Context) (Window, error)

ResolveActiveWindow snapshots live tmux state and returns this session's sole exact active winlink. It returns SnapshotLookupError cardinality errors. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-resolve-window",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{
		Name: "build", WindowName: "editor",
	})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	// A session record names its active window but does not carry it. Resolving
	// asks tmux, so the answer reflects a window selected since.
	window, err := session.ResolveActiveWindow(ctx)
	if err != nil {
		fmt.Println("resolve window:", err)
		return
	}
	name, _ := window.Name()
	fmt.Println(name)
}
Output:
editor

func (Session) RunHook

func (s Session) RunHook(ctx context.Context, name string) error

RunHook asks tmux to run one session hook directly at this stable target. It intentionally performs no racy liveness preflight after validation. Completed failures are secret-safe option errors; cancellation does not prove execution did not occur.

func (Session) SearchPanes

func (s Session) SearchPanes(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Pane, error)

SearchPanes returns this session's pane views selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. The handle's stable session identity limits the projection. Opening and closing identity probes bound the result, which is a newly materialized snapshot rather than a live collection.

func (Session) SearchWindows

func (s Session) SearchWindows(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Window, error)

SearchWindows returns this session's winlinks selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. The handle's stable session identity limits the projection. Opening and closing identity probes bound the result, which is a newly materialized snapshot rather than a live collection.

func (Session) SelectWindow

func (s Session) SelectWindow(
	ctx context.Context,
	request SelectWindowRequest,
) (Window, error)

SelectWindow makes one winlink current in the receiver session and returns that freshly materialized session-specific Window. WindowID is combined with the receiver SessionID, because a WindowID alone does not distinguish linked views. The selection is session-scoped; it does not promise focus for clients attached to other sessions.

Invalid requests match ErrInvalidServerCommandRequest or ErrInvalidRequest before execution. A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Window because the selected view cannot be identified reliably without refresh.

func (Session) Server

func (s Session) Server() Server

Server returns the immutable configured handle that produced the session.

func (Session) SetActivityAction

func (s Session) SetActivityAction(ctx context.Context, value ActivityAction) error

SetActivityAction stores the "activity-action" session option, available since tmux 3.2a. It accepts ActivityAction and does not expose raw set-option flags. Read it back with SessionOptionValues.ActivityAction from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetAssumePasteTime

func (s Session) SetAssumePasteTime(ctx context.Context, value int64) error

SetAssumePasteTime stores the "assume-paste-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.AssumePasteTime from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetBaseIndex

func (s Session) SetBaseIndex(ctx context.Context, value int64) error

SetBaseIndex stores the "base-index" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.BaseIndex from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetBellAction

func (s Session) SetBellAction(ctx context.Context, value BellAction) error

SetBellAction stores the "bell-action" session option, available since tmux 3.2a. It accepts BellAction and does not expose raw set-option flags. Read it back with SessionOptionValues.BellAction from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-bell-action",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	// A typed setter rejects a value tmux would not take, at compile time for
	// the type and through Valid for the connected tmux version.
	if err := session.SetBellAction(ctx, tmux.BellActionNone); err != nil {
		fmt.Println("set bell-action:", err)
		return
	}
	values, err := session.Options(ctx)
	if err != nil {
		fmt.Println("read options:", err)
		return
	}
	action, ok := values.BellAction().Get()
	fmt.Println(action, ok)
}
Output:
none true

func (Session) SetDefaultCommand

func (s Session) SetDefaultCommand(ctx context.Context, value string) error

SetDefaultCommand stores the "default-command" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DefaultCommand from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDefaultShell

func (s Session) SetDefaultShell(ctx context.Context, value string) error

SetDefaultShell stores the "default-shell" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DefaultShell from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDefaultSize

func (s Session) SetDefaultSize(ctx context.Context, value string) error

SetDefaultSize stores the "default-size" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DefaultSize from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDestroyUnattached

func (s Session) SetDestroyUnattached(ctx context.Context, value DestroyUnattached) error

SetDestroyUnattached stores the "destroy-unattached" session option, available since tmux 3.2a. It accepts DestroyUnattached and does not expose raw set-option flags. Read it back with SessionOptionValues.DestroyUnattached from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDetachOnDestroy

func (s Session) SetDetachOnDestroy(ctx context.Context, value DetachOnDestroy) error

SetDetachOnDestroy stores the "detach-on-destroy" session option, available since tmux 3.2a. It accepts DetachOnDestroy and does not expose raw set-option flags. Read it back with SessionOptionValues.DetachOnDestroy from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDisplayPanesActiveColour

func (s Session) SetDisplayPanesActiveColour(ctx context.Context, value string) error

SetDisplayPanesActiveColour stores the "display-panes-active-colour" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayPanesActiveColour from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDisplayPanesColour

func (s Session) SetDisplayPanesColour(ctx context.Context, value string) error

SetDisplayPanesColour stores the "display-panes-colour" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayPanesColour from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDisplayPanesTime

func (s Session) SetDisplayPanesTime(ctx context.Context, value int64) error

SetDisplayPanesTime stores the "display-panes-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayPanesTime from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetDisplayTime

func (s Session) SetDisplayTime(ctx context.Context, value int64) error

SetDisplayTime stores the "display-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.DisplayTime from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetEnvironment

func (s Session) SetEnvironment(
	ctx context.Context,
	name string,
	value string,
	options SetEnvironmentOptions,
) error

SetEnvironment stores a value in this session's tmux environment, targeted by its stable SessionID.

func (Session) SetFocusFollowsMouse

func (s Session) SetFocusFollowsMouse(ctx context.Context, value bool) error

SetFocusFollowsMouse stores the "focus-follows-mouse" session option, available since tmux 3.7. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.FocusFollowsMouse from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetHistoryLimit

func (s Session) SetHistoryLimit(ctx context.Context, value int64) error

SetHistoryLimit stores the "history-limit" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.HistoryLimit from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetHook

func (s Session) SetHook(ctx context.Context, name string, command string) error

SetHook stores a session hook at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (Session) SetHooks

func (s Session) SetHooks(
	ctx context.Context,
	name string,
	values SparseArray[string],
	options SetHooksOptions,
) (SetHooksResult, error)

SetHooks applies indexed session hook commands in ascending order at this handle's stable session target. With ClearExisting it confirms clearing first, stops at the first failure without rollback, and reports confirmed partial progress. Cancellation may follow accepted commands and cannot disprove their delivery.

func (Session) SetInitialRepeatTime

func (s Session) SetInitialRepeatTime(ctx context.Context, value int64) error

SetInitialRepeatTime stores the "initial-repeat-time" session option, available since tmux 3.6. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.InitialRepeatTime from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetKeyTable

func (s Session) SetKeyTable(ctx context.Context, value string) error

SetKeyTable stores the "key-table" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.KeyTable from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetLockAfterTime

func (s Session) SetLockAfterTime(ctx context.Context, value int64) error

SetLockAfterTime stores the "lock-after-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.LockAfterTime from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetLockCommand

func (s Session) SetLockCommand(ctx context.Context, value string) error

SetLockCommand stores the "lock-command" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.LockCommand from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetMessageCommandStyle

func (s Session) SetMessageCommandStyle(ctx context.Context, value string) error

SetMessageCommandStyle stores the "message-command-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageCommandStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetMessageFormat

func (s Session) SetMessageFormat(ctx context.Context, value string) error

SetMessageFormat stores the "message-format" session option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageFormat from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetMessageLine

func (s Session) SetMessageLine(ctx context.Context, value MessageLine) error

SetMessageLine stores the "message-line" session option, available since tmux 3.4. It accepts MessageLine and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageLine from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetMessageStyle

func (s Session) SetMessageStyle(ctx context.Context, value string) error

SetMessageStyle stores the "message-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.MessageStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetMouse

func (s Session) SetMouse(ctx context.Context, value bool) error

SetMouse stores the "mouse" session option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.Mouse from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-set-mouse",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	// The typed setter takes the option's own type, so a boolean option is set
	// with a bool rather than with tmux's "on" and "off".
	if err := session.SetMouse(ctx, true); err != nil {
		fmt.Println("set mouse:", err)
		return
	}

	options, err := session.Options(ctx)
	if err != nil {
		fmt.Println("read options:", err)
		return
	}
	mouse, _ := options.Mouse().Get()
	fmt.Println(mouse)
}
Output:
true

func (Session) SetOption

func (s Session) SetOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

SetOption stores a session option at this stable session target without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (Session) SetPrefix

func (s Session) SetPrefix(ctx context.Context, value string) error

SetPrefix stores the "prefix" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.Prefix from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetPrefix2

func (s Session) SetPrefix2(ctx context.Context, value string) error

SetPrefix2 stores the "prefix2" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.Prefix2 from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetPromptCommandCursorStyle

func (s Session) SetPromptCommandCursorStyle(ctx context.Context, value PromptCommandCursorStyle) error

SetPromptCommandCursorStyle stores the "prompt-command-cursor-style" session option, available since tmux 3.7. It accepts PromptCommandCursorStyle and does not expose raw set-option flags. Read it back with SessionOptionValues.PromptCommandCursorStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetPromptCursorColour

func (s Session) SetPromptCursorColour(ctx context.Context, value string) error

SetPromptCursorColour stores the "prompt-cursor-colour" session option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.PromptCursorColour from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetPromptCursorStyle

func (s Session) SetPromptCursorStyle(ctx context.Context, value PromptCursorStyle) error

SetPromptCursorStyle stores the "prompt-cursor-style" session option, available since tmux 3.6. It accepts PromptCursorStyle and does not expose raw set-option flags. Read it back with SessionOptionValues.PromptCursorStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetRenumberWindows

func (s Session) SetRenumberWindows(ctx context.Context, value bool) error

SetRenumberWindows stores the "renumber-windows" session option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.RenumberWindows from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetRepeatTime

func (s Session) SetRepeatTime(ctx context.Context, value int64) error

SetRepeatTime stores the "repeat-time" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.RepeatTime from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetSilenceAction

func (s Session) SetSilenceAction(ctx context.Context, value SilenceAction) error

SetSilenceAction stores the "silence-action" session option, available since tmux 3.2a. It accepts SilenceAction and does not expose raw set-option flags. Read it back with SessionOptionValues.SilenceAction from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatus

func (s Session) SetStatus(ctx context.Context, value Status) error

SetStatus stores the "status" session option, available since tmux 3.2a. It accepts Status and does not expose raw set-option flags. Read it back with SessionOptionValues.Status from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusBG

func (s Session) SetStatusBG(ctx context.Context, value string) error

SetStatusBG stores the "status-bg" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusBG from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusFG

func (s Session) SetStatusFG(ctx context.Context, value string) error

SetStatusFG stores the "status-fg" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusFG from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusFormat

func (s Session) SetStatusFormat(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetStatusFormat performs a complete replacement of the "status-format" session option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusFormat from Session.Options. Use Session.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Session.UnsetOption to restore inheritance or the global default.

func (Session) SetStatusInterval

func (s Session) SetStatusInterval(ctx context.Context, value int64) error

SetStatusInterval stores the "status-interval" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusInterval from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusJustify

func (s Session) SetStatusJustify(ctx context.Context, value StatusJustify) error

SetStatusJustify stores the "status-justify" session option, available since tmux 3.2a. It accepts StatusJustify and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusJustify from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusKeys

func (s Session) SetStatusKeys(ctx context.Context, value StatusKeys) error

SetStatusKeys stores the "status-keys" session option, available since tmux 3.2a. It accepts StatusKeys and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusKeys from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusLeft

func (s Session) SetStatusLeft(ctx context.Context, value string) error

SetStatusLeft stores the "status-left" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusLeft from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusLeftLength

func (s Session) SetStatusLeftLength(ctx context.Context, value int64) error

SetStatusLeftLength stores the "status-left-length" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusLeftLength from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusLeftStyle

func (s Session) SetStatusLeftStyle(ctx context.Context, value string) error

SetStatusLeftStyle stores the "status-left-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusLeftStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusPosition

func (s Session) SetStatusPosition(ctx context.Context, value StatusPosition) error

SetStatusPosition stores the "status-position" session option, available since tmux 3.2a. It accepts StatusPosition and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusPosition from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusRight

func (s Session) SetStatusRight(ctx context.Context, value string) error

SetStatusRight stores the "status-right" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusRight from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusRightLength

func (s Session) SetStatusRightLength(ctx context.Context, value int64) error

SetStatusRightLength stores the "status-right-length" session option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusRightLength from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusRightStyle

func (s Session) SetStatusRightStyle(ctx context.Context, value string) error

SetStatusRightStyle stores the "status-right-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusRightStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetStatusStyle

func (s Session) SetStatusStyle(ctx context.Context, value string) error

SetStatusStyle stores the "status-style" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.StatusStyle from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetTitles

func (s Session) SetTitles(ctx context.Context, value bool) error

SetTitles stores the "set-titles" session option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with SessionOptionValues.SetTitles from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetTitlesString

func (s Session) SetTitlesString(ctx context.Context, value string) error

SetTitlesString stores the "set-titles-string" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.SetTitlesString from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetUpdateEnvironment

func (s Session) SetUpdateEnvironment(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetUpdateEnvironment performs a complete replacement of the "update-environment" session option, available since tmux 3.2a. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with SessionOptionValues.UpdateEnvironment from Session.Options. Use Session.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Session.UnsetOption to restore inheritance or the global default.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// exampleWaitBudget bounds an example waiting on a program in a pane. It is a
// ceiling rather than a delay -- each wait below ends as soon as its condition
// holds -- so it is generous: one tight enough to be exceeded on a busy machine
// fails an example with nothing wrong with it.
const exampleWaitBudget = 60 * time.Second

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), exampleWaitBudget)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-update-environment",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}

	// An array option is addressed by index, and the indices need not be
	// contiguous: this sets 0 and 3 and leaves 1 and 2 unset.
	values, err := tmux.NewSparseArray(
		tmux.SparseEntry[string]{Index: 0, Value: "DISPLAY"},
		tmux.SparseEntry[string]{Index: 3, Value: "SSH_AUTH_SOCK"},
	)
	if err != nil {
		fmt.Println("build array:", err)
		return
	}
	result, err := session.SetUpdateEnvironment(ctx, values)
	if err != nil {
		fmt.Println("set update-environment:", err)
		return
	}
	fmt.Println(result.Replaced, result.AppliedIndices)
}
Output:
true [0 3]

func (Session) SetVisualActivity

func (s Session) SetVisualActivity(ctx context.Context, value VisualActivity) error

SetVisualActivity stores the "visual-activity" session option, available since tmux 3.2a. It accepts VisualActivity and does not expose raw set-option flags. Read it back with SessionOptionValues.VisualActivity from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetVisualBell

func (s Session) SetVisualBell(ctx context.Context, value VisualBell) error

SetVisualBell stores the "visual-bell" session option, available since tmux 3.2a. It accepts VisualBell and does not expose raw set-option flags. Read it back with SessionOptionValues.VisualBell from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetVisualSilence

func (s Session) SetVisualSilence(ctx context.Context, value VisualSilence) error

SetVisualSilence stores the "visual-silence" session option, available since tmux 3.2a. It accepts VisualSilence and does not expose raw set-option flags. Read it back with SessionOptionValues.VisualSilence from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) SetWordSeparators

func (s Session) SetWordSeparators(ctx context.Context, value string) error

SetWordSeparators stores the "word-separators" session option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with SessionOptionValues.WordSeparators from Session.Options, and Session.UnsetOption restores inheritance or the global default. Use Session.SetOption for caller-named options or raw values.

func (Session) ShowEnvironment

func (s Session) ShowEnvironment(ctx context.Context) (map[string]EnvironmentValue, error)

ShowEnvironment returns an owned session-scoped non-hidden tmux environment. Completed command failures return an empty map unless strict errors are enabled. Externally injected multiline entries return ErrMalformedEnvironment because tmux's multi-entry output does not frame continuation lines. Decode errors are compatible with ErrMalformedEnvironment and return no partial map.

func (Session) SilenceFlag

func (s Session) SilenceFlag() (bool, bool)

SilenceFlag returns a typed bool value and an ok result parsed from tmux #{session_silence_flag} in this Session's materialized session-scoped record (tmux 3.6 or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Stack

func (s Session) Stack() (string, bool)

Stack returns a typed string value and an ok result parsed from tmux #{session_stack} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) String

func (s Session) String() string

String returns the session's stable ID and queried name.

func (Session) SwitchClient

func (s Session) SwitchClient(ctx context.Context) error

SwitchClient switches tmux's current client to the session identified by this handle's stable ID.

func (Session) UnsetEnvironment

func (s Session) UnsetEnvironment(ctx context.Context, name string) error

UnsetEnvironment deletes a value from this session's tmux environment, targeted by its stable SessionID.

func (Session) UnsetHook

func (s Session) UnsetHook(ctx context.Context, name string) error

UnsetHook removes every matching session hook index at this stable session target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the unset was accepted.

func (Session) UnsetOption

func (s Session) UnsetOption(
	ctx context.Context,
	name string,
	options UnsetOptionOptions,
) error

UnsetOption unsets a session option at this stable session target without refreshing models. UnsetPanes is invalid at this scope; cancellation does not prove the unset was not accepted.

func (Session) WindowCount

func (s Session) WindowCount() (int, bool)

WindowCount returns a typed int value and an ok result parsed from tmux #{session_windows} in this Session's materialized session-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Session.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Session) Windows

func (s Session) Windows() ([]Window, bool)

Windows returns newly allocated shallow copies of this snapshot record's winlink views, and reports whether the receiver carries relations at all.

It never queries tmux. Server.Snapshot and the resolvers carry relations; a targeted point lookup, Session.Refresh, and Server.NewSession do not, and report false rather than no windows. The distinction is not decoration: tmux destroys a session when its last window closes, so a materialized session with no windows does not exist, and reporting one would be a record that silently traverses to nothing. Use Session.SearchWindows with a nil filter for the session's current windows.

func (Session) WithServer

func (s Session) WithServer(server Server) Session

WithServer returns a copy of the session whose operations run through server. It is the write half of Session.Server and queries tmux for nothing: a record holds its handle as a plain field, so moving one onto a handle that selected an Engine with Server.WithEngine costs a struct copy rather than a second lookup.

It exists because a record keeps the handle that produced it. One obtained before an engine was selected keeps starting a tmux process for every command and reports no error while doing so, which is the failure this turns into a one-line fix.

Nothing checks that server addresses the same tmux server, because nothing here talks to tmux. A record moved onto a handle with another socket resolves against whatever answers there and reports a missing target at its next command rather than at this call.

Session.Windows and Session.Panes carry the handle of the record they are read from, so one move covers the relations reached through it.

type SessionFilter

type SessionFilter struct {
	// ID exactly matches the stable tmux session identifier from Session.ID, including its $ sigil. A nil pointer leaves ID unset; a non-nil pointer applies it, including when it points to the zero value.
	ID *SessionID `json:"id,omitempty"`
	// IDIn lists accepted values for the stable tmux session identifier from Session.ID, including its $ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves IDIn unset; a non-nil empty slice is invalid.
	IDIn []SessionID `json:"idIn,omitempty"`
	// Name exactly matches the materialized session name from Session.Name. A nil pointer leaves Name unset; a non-nil pointer applies it, including when it points to the zero value.
	Name *string `json:"name,omitempty"`
	// NameIn lists accepted values for the materialized session name from Session.Name. A candidate matches when its materialized value equals one listed value. A nil slice leaves NameIn unset; a non-nil empty slice is invalid.
	NameIn []string `json:"nameIn,omitempty"`
	// NameContains requires the materialized session name from Session.Name to contain the pointed-to substring. A nil pointer leaves NameContains unset; a non-nil pointer applies it, and an empty string matches every available string.
	NameContains *string `json:"nameContains,omitempty"`
	// NameRegex requires the materialized session name from Session.Name to match Go regular expression syntax. An empty string leaves NameRegex unset.
	NameRegex string `json:"nameRegex,omitempty"`
	// Attached exactly matches the materialized attachment state from Session.Attached. A nil pointer leaves Attached unset; a non-nil pointer applies it, including when it points to the zero value.
	Attached *bool `json:"attached,omitempty"`
	// AnyOf additionally requires at least one branch to match after ordinary criteria match. A nil slice leaves AnyOf unset; a non-nil empty slice is invalid.
	AnyOf []SessionFilter `json:"anyOf,omitempty"`
	// Not excludes a candidate when its nested filter matches. A nil pointer leaves Not unset.
	Not *SessionFilter `json:"not,omitempty"`
	// Windows traverses the materialized window views returned by Session.Windows. A nil pointer leaves the relation criterion unset.
	Windows *WindowRel `json:"windows,omitempty"`
	// Panes traverses the materialized pane views returned by Session.Panes. A nil pointer leaves the relation criterion unset.
	Panes *PaneRel `json:"panes,omitempty"`
}

SessionFilter evaluates already-materialized Session values and never runs tmux. Its zero value matches every non-nil candidate. Ordinary field and relation criteria are ANDed. AnyOf additionally requires at least one branch to match; Not excludes a match. Field and relation criteria correspond to Session.ID, Session.Name, Session.Attached, Session.Windows, and Session.Panes. SessionFilter.Predicate, SessionFilter.MarshalJSON, and SessionFilter.UnmarshalJSON validate automatically. Use SessionFilter.Validate to check a filter constructed directly.

func ParseSessionLookup

func ParseSessionLookup(lookup string, values ...string) (SessionFilter, error)

ParseSessionLookup converts a lookup path into a concrete session filter. Paths traverse generated JSON relation names and separate segments with double underscores. The default operator is exact. Accepted suffixes are eq, exact, iexact, contains, icontains, startswith, istartswith, endswith, iendswith, in, nin, regex, and iregex; availability is field-specific. The eq suffix aliases exact, nin negates in, scalar operators require one value, and in and nin require one or more. Invalid paths, operators, values, or results return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func SessionAttachedIs

func SessionAttachedIs(value bool) SessionFilter

SessionAttachedIs returns a SessionFilter that exactly matches the materialized attachment state from Session.Attached. It sets no other criteria and does not validate value.

func SessionIDIs

func SessionIDIs(value SessionID) SessionFilter

SessionIDIs returns a SessionFilter that exactly matches the stable tmux session identifier from Session.ID, including its $ sigil. It sets no other criteria and does not validate value.

func SessionNameIs

func SessionNameIs(value string) SessionFilter

SessionNameIs returns a SessionFilter that exactly matches the materialized session name from Session.Name. It sets no other criteria and does not validate value.

func (SessionFilter) MarshalJSON

func (filter SessionFilter) MarshalJSON() ([]byte, error)

MarshalJSON validates the session filter and encodes its JSON wire object. FilterSchemaVersion remains external metadata and is not embedded in the object. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (SessionFilter) Predicate

func (filter SessionFilter) Predicate() (func(*Session) bool, error)

Predicate validates the session filter and returns a local predicate accepting Session values already materialized by a Snapshot; it never runs tmux. Relation criteria traverse only relationships already materialized on that candidate. The predicate returns false for a nil candidate. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (*SessionFilter) UnmarshalJSON

func (filter *SessionFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON clears the receiver, then decodes a strict session filter JSON object. FilterSchemaVersion remains external metadata and is not embedded in the object. It rejects unknown or duplicate fields and trailing JSON, then validates decoded criteria. On error, the receiver can retain a partial or complete decoded value. All decode and framing failures and semantic validation failures return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (SessionFilter) Validate

func (filter SessionFilter) Validate() error

Validate checks structure, regular expressions, and contradictory criteria before filter use. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

type SessionHookValues

type SessionHookValues struct {
	// contains filtered or unexported fields
}

SessionHookValues is an immutable point-in-time view of known session hook values. Its zero value has no present values. Obtain it with Session.Hooks; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (SessionHookValues) AfterBindKey

func (v SessionHookValues) AfterBindKey() OptionValue[SparseArray[string]]

AfterBindKey returns the "after-bind-key" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterCapturePane

func (v SessionHookValues) AfterCapturePane() OptionValue[SparseArray[string]]

AfterCapturePane returns the "after-capture-pane" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterCopyMode

func (v SessionHookValues) AfterCopyMode() OptionValue[SparseArray[string]]

AfterCopyMode returns the "after-copy-mode" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterDisplayMessage

func (v SessionHookValues) AfterDisplayMessage() OptionValue[SparseArray[string]]

AfterDisplayMessage returns the "after-display-message" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterDisplayPanes

func (v SessionHookValues) AfterDisplayPanes() OptionValue[SparseArray[string]]

AfterDisplayPanes returns the "after-display-panes" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterKillPane

func (v SessionHookValues) AfterKillPane() OptionValue[SparseArray[string]]

AfterKillPane returns the "after-kill-pane" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterListBuffers

func (v SessionHookValues) AfterListBuffers() OptionValue[SparseArray[string]]

AfterListBuffers returns the "after-list-buffers" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterListClients

func (v SessionHookValues) AfterListClients() OptionValue[SparseArray[string]]

AfterListClients returns the "after-list-clients" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterListKeys

func (v SessionHookValues) AfterListKeys() OptionValue[SparseArray[string]]

AfterListKeys returns the "after-list-keys" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterListPanes

func (v SessionHookValues) AfterListPanes() OptionValue[SparseArray[string]]

AfterListPanes returns the "after-list-panes" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterListSessions

func (v SessionHookValues) AfterListSessions() OptionValue[SparseArray[string]]

AfterListSessions returns the "after-list-sessions" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterListWindows

func (v SessionHookValues) AfterListWindows() OptionValue[SparseArray[string]]

AfterListWindows returns the "after-list-windows" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterLoadBuffer

func (v SessionHookValues) AfterLoadBuffer() OptionValue[SparseArray[string]]

AfterLoadBuffer returns the "after-load-buffer" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterLockServer

func (v SessionHookValues) AfterLockServer() OptionValue[SparseArray[string]]

AfterLockServer returns the "after-lock-server" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterNewSession

func (v SessionHookValues) AfterNewSession() OptionValue[SparseArray[string]]

AfterNewSession returns the "after-new-session" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterNewWindow

func (v SessionHookValues) AfterNewWindow() OptionValue[SparseArray[string]]

AfterNewWindow returns the "after-new-window" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterPasteBuffer

func (v SessionHookValues) AfterPasteBuffer() OptionValue[SparseArray[string]]

AfterPasteBuffer returns the "after-paste-buffer" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterPipePane

func (v SessionHookValues) AfterPipePane() OptionValue[SparseArray[string]]

AfterPipePane returns the "after-pipe-pane" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterQueue

AfterQueue returns the "after-queue" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterRefreshClient

func (v SessionHookValues) AfterRefreshClient() OptionValue[SparseArray[string]]

AfterRefreshClient returns the "after-refresh-client" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterRenameSession

func (v SessionHookValues) AfterRenameSession() OptionValue[SparseArray[string]]

AfterRenameSession returns the "after-rename-session" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterRenameWindow

func (v SessionHookValues) AfterRenameWindow() OptionValue[SparseArray[string]]

AfterRenameWindow returns the "after-rename-window" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterResizePane

func (v SessionHookValues) AfterResizePane() OptionValue[SparseArray[string]]

AfterResizePane returns the "after-resize-pane" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterResizeWindow

func (v SessionHookValues) AfterResizeWindow() OptionValue[SparseArray[string]]

AfterResizeWindow returns the "after-resize-window" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSaveBuffer

func (v SessionHookValues) AfterSaveBuffer() OptionValue[SparseArray[string]]

AfterSaveBuffer returns the "after-save-buffer" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSelectLayout

func (v SessionHookValues) AfterSelectLayout() OptionValue[SparseArray[string]]

AfterSelectLayout returns the "after-select-layout" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSelectPane

func (v SessionHookValues) AfterSelectPane() OptionValue[SparseArray[string]]

AfterSelectPane returns the "after-select-pane" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSelectWindow

func (v SessionHookValues) AfterSelectWindow() OptionValue[SparseArray[string]]

AfterSelectWindow returns the "after-select-window" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSendKeys

func (v SessionHookValues) AfterSendKeys() OptionValue[SparseArray[string]]

AfterSendKeys returns the "after-send-keys" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSetBuffer

func (v SessionHookValues) AfterSetBuffer() OptionValue[SparseArray[string]]

AfterSetBuffer returns the "after-set-buffer" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSetEnvironment

func (v SessionHookValues) AfterSetEnvironment() OptionValue[SparseArray[string]]

AfterSetEnvironment returns the "after-set-environment" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSetHook

func (v SessionHookValues) AfterSetHook() OptionValue[SparseArray[string]]

AfterSetHook returns the "after-set-hook" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSetOption

func (v SessionHookValues) AfterSetOption() OptionValue[SparseArray[string]]

AfterSetOption returns the "after-set-option" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterShowEnvironment

func (v SessionHookValues) AfterShowEnvironment() OptionValue[SparseArray[string]]

AfterShowEnvironment returns the "after-show-environment" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterShowMessages

func (v SessionHookValues) AfterShowMessages() OptionValue[SparseArray[string]]

AfterShowMessages returns the "after-show-messages" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterShowOptions

func (v SessionHookValues) AfterShowOptions() OptionValue[SparseArray[string]]

AfterShowOptions returns the "after-show-options" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterSplitWindow

func (v SessionHookValues) AfterSplitWindow() OptionValue[SparseArray[string]]

AfterSplitWindow returns the "after-split-window" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AfterUnbindKey

func (v SessionHookValues) AfterUnbindKey() OptionValue[SparseArray[string]]

AfterUnbindKey returns the "after-unbind-key" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AlertActivity

func (v SessionHookValues) AlertActivity() OptionValue[SparseArray[string]]

AlertActivity returns the "alert-activity" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AlertBell

AlertBell returns the "alert-bell" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) AlertSilence

func (v SessionHookValues) AlertSilence() OptionValue[SparseArray[string]]

AlertSilence returns the "alert-silence" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientActive

func (v SessionHookValues) ClientActive() OptionValue[SparseArray[string]]

ClientActive returns the "client-active" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientAttached

func (v SessionHookValues) ClientAttached() OptionValue[SparseArray[string]]

ClientAttached returns the "client-attached" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientDarkTheme

func (v SessionHookValues) ClientDarkTheme() OptionValue[SparseArray[string]]

ClientDarkTheme returns the "client-dark-theme" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.6. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientDetached

func (v SessionHookValues) ClientDetached() OptionValue[SparseArray[string]]

ClientDetached returns the "client-detached" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientFocusIn

func (v SessionHookValues) ClientFocusIn() OptionValue[SparseArray[string]]

ClientFocusIn returns the "client-focus-in" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientFocusOut

func (v SessionHookValues) ClientFocusOut() OptionValue[SparseArray[string]]

ClientFocusOut returns the "client-focus-out" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientLightTheme

func (v SessionHookValues) ClientLightTheme() OptionValue[SparseArray[string]]

ClientLightTheme returns the "client-light-theme" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.6. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientResized

func (v SessionHookValues) ClientResized() OptionValue[SparseArray[string]]

ClientResized returns the "client-resized" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) ClientSessionChanged

func (v SessionHookValues) ClientSessionChanged() OptionValue[SparseArray[string]]

ClientSessionChanged returns the "client-session-changed" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) CommandError

func (v SessionHookValues) CommandError() OptionValue[SparseArray[string]]

CommandError returns the "command-error" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.5. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) SessionClosed

func (v SessionHookValues) SessionClosed() OptionValue[SparseArray[string]]

SessionClosed returns the "session-closed" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) SessionCreated

func (v SessionHookValues) SessionCreated() OptionValue[SparseArray[string]]

SessionCreated returns the "session-created" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) SessionRenamed

func (v SessionHookValues) SessionRenamed() OptionValue[SparseArray[string]]

SessionRenamed returns the "session-renamed" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) SessionWindowChanged

func (v SessionHookValues) SessionWindowChanged() OptionValue[SparseArray[string]]

SessionWindowChanged returns the "session-window-changed" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) WindowLinked

func (v SessionHookValues) WindowLinked() OptionValue[SparseArray[string]]

WindowLinked returns the "window-linked" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionHookValues) WindowUnlinked

func (v SessionHookValues) WindowUnlinked() OptionValue[SparseArray[string]]

WindowUnlinked returns the "window-unlinked" session hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use Session.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

type SessionID

type SessionID string

SessionID is tmux's stable session identifier, including its $ sigil. The zero value is not a usable tmux target.

func (SessionID) String

func (id SessionID) String() string

String returns the tmux identifier verbatim.

type SessionKillRequest

type SessionKillRequest struct {
	// AllExcept terminates every other session and detaches their clients while
	// preserving the receiver session.
	AllExcept bool
	// ClearAlerts clears bell, activity, and silence alerts in every window linked
	// to the receiver without destroying a session or detaching its clients.
	ClearAlerts bool
	// Group terminates every session in the receiver's group and detaches their
	// clients on tmux 3.7 or newer. Older versions warn synchronously and omit
	// the unsupported flag, so only the receiver is terminated.
	Group bool
}

SessionKillRequest configures kill-session on tmux 3.2a or later. Its zero value destroys the receiver session. AllExcept destroys other sessions instead, while ClearAlerts is non-destructive. AllExcept, ClearAlerts, and Group are mutually exclusive because tmux applies a hidden precedence when more than one mode is supplied; the package rejects those combinations before execution. The request contains no retained caller-owned storage. Group's compatibility behavior is documented on that field.

type SessionOptionValues

type SessionOptionValues struct {
	// contains filtered or unexported fields
}

SessionOptionValues is an immutable point-in-time view of known session option values. Its zero value has no present values. Obtain it with Session.Options or GlobalSessionScope.Options; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (SessionOptionValues) ActivityAction

func (v SessionOptionValues) ActivityAction() OptionValue[ActivityAction]

ActivityAction returns the "activity-action" session option value as OptionValue with Go value shape OptionValue[ActivityAction]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "none", "any", "current", "other"). Set it with Session.SetActivityAction or GlobalSessionScope.SetActivityAction. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) AssumePasteTime

func (v SessionOptionValues) AssumePasteTime() OptionValue[int64]

AssumePasteTime returns the "assume-paste-time" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetAssumePasteTime or GlobalSessionScope.SetAssumePasteTime. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) BaseIndex

func (v SessionOptionValues) BaseIndex() OptionValue[int64]

BaseIndex returns the "base-index" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetBaseIndex or GlobalSessionScope.SetBaseIndex. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) BellAction

func (v SessionOptionValues) BellAction() OptionValue[BellAction]

BellAction returns the "bell-action" session option value as OptionValue with Go value shape OptionValue[BellAction]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "none", "any", "current", "other"). Set it with Session.SetBellAction or GlobalSessionScope.SetBellAction. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DefaultCommand

func (v SessionOptionValues) DefaultCommand() OptionValue[string]

DefaultCommand returns the "default-command" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetDefaultCommand or GlobalSessionScope.SetDefaultCommand. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DefaultShell

func (v SessionOptionValues) DefaultShell() OptionValue[string]

DefaultShell returns the "default-shell" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetDefaultShell or GlobalSessionScope.SetDefaultShell. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DefaultSize

func (v SessionOptionValues) DefaultSize() OptionValue[string]

DefaultSize returns the "default-size" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetDefaultSize or GlobalSessionScope.SetDefaultSize. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DestroyUnattached

func (v SessionOptionValues) DestroyUnattached() OptionValue[DestroyUnattached]

DestroyUnattached returns the "destroy-unattached" session option value as OptionValue with Go value shape OptionValue[DestroyUnattached]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a; CHOICE since tmux 3.4 (choices: "off", "on", "keep-last", "keep-group"). Set it with Session.SetDestroyUnattached or GlobalSessionScope.SetDestroyUnattached. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DetachOnDestroy

func (v SessionOptionValues) DetachOnDestroy() OptionValue[DetachOnDestroy]

DetachOnDestroy returns the "detach-on-destroy" session option value as OptionValue with Go value shape OptionValue[DetachOnDestroy]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "no-detached"); CHOICE since tmux 3.4 (choices: "off", "on", "no-detached", "previous", "next"). Set it with Session.SetDetachOnDestroy or GlobalSessionScope.SetDetachOnDestroy. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DisplayPanesActiveColour

func (v SessionOptionValues) DisplayPanesActiveColour() OptionValue[string]

DisplayPanesActiveColour returns the "display-panes-active-colour" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.2a. Set it with Session.SetDisplayPanesActiveColour or GlobalSessionScope.SetDisplayPanesActiveColour. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DisplayPanesColour

func (v SessionOptionValues) DisplayPanesColour() OptionValue[string]

DisplayPanesColour returns the "display-panes-colour" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.2a. Set it with Session.SetDisplayPanesColour or GlobalSessionScope.SetDisplayPanesColour. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DisplayPanesTime

func (v SessionOptionValues) DisplayPanesTime() OptionValue[int64]

DisplayPanesTime returns the "display-panes-time" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetDisplayPanesTime or GlobalSessionScope.SetDisplayPanesTime. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) DisplayTime

func (v SessionOptionValues) DisplayTime() OptionValue[int64]

DisplayTime returns the "display-time" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetDisplayTime or GlobalSessionScope.SetDisplayTime. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) FocusFollowsMouse

func (v SessionOptionValues) FocusFollowsMouse() OptionValue[bool]

FocusFollowsMouse returns the "focus-follows-mouse" session option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.7. Set it with Session.SetFocusFollowsMouse or GlobalSessionScope.SetFocusFollowsMouse. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) HistoryLimit

func (v SessionOptionValues) HistoryLimit() OptionValue[int64]

HistoryLimit returns the "history-limit" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetHistoryLimit or GlobalSessionScope.SetHistoryLimit. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) InitialRepeatTime

func (v SessionOptionValues) InitialRepeatTime() OptionValue[int64]

InitialRepeatTime returns the "initial-repeat-time" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.6. Set it with Session.SetInitialRepeatTime or GlobalSessionScope.SetInitialRepeatTime. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) KeyTable

func (v SessionOptionValues) KeyTable() OptionValue[string]

KeyTable returns the "key-table" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetKeyTable or GlobalSessionScope.SetKeyTable. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) LockAfterTime

func (v SessionOptionValues) LockAfterTime() OptionValue[int64]

LockAfterTime returns the "lock-after-time" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetLockAfterTime or GlobalSessionScope.SetLockAfterTime. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) LockCommand

func (v SessionOptionValues) LockCommand() OptionValue[string]

LockCommand returns the "lock-command" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetLockCommand or GlobalSessionScope.SetLockCommand. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) MessageCommandStyle

func (v SessionOptionValues) MessageCommandStyle() OptionValue[string]

MessageCommandStyle returns the "message-command-style" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetMessageCommandStyle or GlobalSessionScope.SetMessageCommandStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is a style option.

func (SessionOptionValues) MessageFormat

func (v SessionOptionValues) MessageFormat() OptionValue[string]

MessageFormat returns the "message-format" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Session.SetMessageFormat or GlobalSessionScope.SetMessageFormat. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) MessageLine

func (v SessionOptionValues) MessageLine() OptionValue[MessageLine]

MessageLine returns the "message-line" session option value as OptionValue with Go value shape OptionValue[MessageLine]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.4 (choices: "0", "1", "2", "3", "4"). Set it with Session.SetMessageLine or GlobalSessionScope.SetMessageLine. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) MessageStyle

func (v SessionOptionValues) MessageStyle() OptionValue[string]

MessageStyle returns the "message-style" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetMessageStyle or GlobalSessionScope.SetMessageStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is a style option.

func (SessionOptionValues) Mouse

Mouse returns the "mouse" session option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Session.SetMouse or GlobalSessionScope.SetMouse. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) Prefix

Prefix returns the "prefix" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are KEY since tmux 3.2a. Set it with Session.SetPrefix or GlobalSessionScope.SetPrefix. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) Prefix2

func (v SessionOptionValues) Prefix2() OptionValue[string]

Prefix2 returns the "prefix2" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are KEY since tmux 3.2a. Set it with Session.SetPrefix2 or GlobalSessionScope.SetPrefix2. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) PromptCommandCursorStyle

func (v SessionOptionValues) PromptCommandCursorStyle() OptionValue[PromptCommandCursorStyle]

PromptCommandCursorStyle returns the "prompt-command-cursor-style" session option value as OptionValue with Go value shape OptionValue[PromptCommandCursorStyle]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.7 (choices: "default", "blinking-block", "block", "blinking-underline", "underline", "blinking-bar", "bar"). Set it with Session.SetPromptCommandCursorStyle or GlobalSessionScope.SetPromptCommandCursorStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) PromptCursorColour

func (v SessionOptionValues) PromptCursorColour() OptionValue[string]

PromptCursorColour returns the "prompt-cursor-colour" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.6. Set it with Session.SetPromptCursorColour or GlobalSessionScope.SetPromptCursorColour. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) PromptCursorStyle

func (v SessionOptionValues) PromptCursorStyle() OptionValue[PromptCursorStyle]

PromptCursorStyle returns the "prompt-cursor-style" session option value as OptionValue with Go value shape OptionValue[PromptCursorStyle]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.6 (choices: "default", "blinking-block", "block", "blinking-underline", "underline", "blinking-bar", "bar"). Set it with Session.SetPromptCursorStyle or GlobalSessionScope.SetPromptCursorStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) RenumberWindows

func (v SessionOptionValues) RenumberWindows() OptionValue[bool]

RenumberWindows returns the "renumber-windows" session option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Session.SetRenumberWindows or GlobalSessionScope.SetRenumberWindows. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) RepeatTime

func (v SessionOptionValues) RepeatTime() OptionValue[int64]

RepeatTime returns the "repeat-time" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetRepeatTime or GlobalSessionScope.SetRepeatTime. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) SetTitles

func (v SessionOptionValues) SetTitles() OptionValue[bool]

SetTitles returns the "set-titles" session option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Session.SetTitles or GlobalSessionScope.SetTitles. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) SetTitlesString

func (v SessionOptionValues) SetTitlesString() OptionValue[string]

SetTitlesString returns the "set-titles-string" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetTitlesString or GlobalSessionScope.SetTitlesString. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) SilenceAction

func (v SessionOptionValues) SilenceAction() OptionValue[SilenceAction]

SilenceAction returns the "silence-action" session option value as OptionValue with Go value shape OptionValue[SilenceAction]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "none", "any", "current", "other"). Set it with Session.SetSilenceAction or GlobalSessionScope.SetSilenceAction. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) Status

Status returns the "status" session option value as OptionValue with Go value shape OptionValue[Status]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "2", "3", "4", "5"). Set it with Session.SetStatus or GlobalSessionScope.SetStatus. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusBG

func (v SessionOptionValues) StatusBG() OptionValue[string]

StatusBG returns the "status-bg" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.2a. Set it with Session.SetStatusBG or GlobalSessionScope.SetStatusBG. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusFG

func (v SessionOptionValues) StatusFG() OptionValue[string]

StatusFG returns the "status-fg" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.2a. Set it with Session.SetStatusFG or GlobalSessionScope.SetStatusFG. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusFormat

StatusFormat returns the "status-format" session option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetStatusFormat or GlobalSessionScope.SetStatusFormat. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionOptionValues) StatusInterval

func (v SessionOptionValues) StatusInterval() OptionValue[int64]

StatusInterval returns the "status-interval" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetStatusInterval or GlobalSessionScope.SetStatusInterval. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusJustify

func (v SessionOptionValues) StatusJustify() OptionValue[StatusJustify]

StatusJustify returns the "status-justify" session option value as OptionValue with Go value shape OptionValue[StatusJustify]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "left", "centre", "right", "absolute-centre"). Set it with Session.SetStatusJustify or GlobalSessionScope.SetStatusJustify. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusKeys

func (v SessionOptionValues) StatusKeys() OptionValue[StatusKeys]

StatusKeys returns the "status-keys" session option value as OptionValue with Go value shape OptionValue[StatusKeys]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "emacs", "vi"). Set it with Session.SetStatusKeys or GlobalSessionScope.SetStatusKeys. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusLeft

func (v SessionOptionValues) StatusLeft() OptionValue[string]

StatusLeft returns the "status-left" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetStatusLeft or GlobalSessionScope.SetStatusLeft. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusLeftLength

func (v SessionOptionValues) StatusLeftLength() OptionValue[int64]

StatusLeftLength returns the "status-left-length" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetStatusLeftLength or GlobalSessionScope.SetStatusLeftLength. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusLeftStyle

func (v SessionOptionValues) StatusLeftStyle() OptionValue[string]

StatusLeftStyle returns the "status-left-style" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetStatusLeftStyle or GlobalSessionScope.SetStatusLeftStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is a style option.

func (SessionOptionValues) StatusPosition

func (v SessionOptionValues) StatusPosition() OptionValue[StatusPosition]

StatusPosition returns the "status-position" session option value as OptionValue with Go value shape OptionValue[StatusPosition]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "top", "bottom"). Set it with Session.SetStatusPosition or GlobalSessionScope.SetStatusPosition. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusRight

func (v SessionOptionValues) StatusRight() OptionValue[string]

StatusRight returns the "status-right" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetStatusRight or GlobalSessionScope.SetStatusRight. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusRightLength

func (v SessionOptionValues) StatusRightLength() OptionValue[int64]

StatusRightLength returns the "status-right-length" session option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Session.SetStatusRightLength or GlobalSessionScope.SetStatusRightLength. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) StatusRightStyle

func (v SessionOptionValues) StatusRightStyle() OptionValue[string]

StatusRightStyle returns the "status-right-style" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetStatusRightStyle or GlobalSessionScope.SetStatusRightStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is a style option.

func (SessionOptionValues) StatusStyle

func (v SessionOptionValues) StatusStyle() OptionValue[string]

StatusStyle returns the "status-style" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetStatusStyle or GlobalSessionScope.SetStatusStyle. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is a style option.

func (SessionOptionValues) UpdateEnvironment

func (v SessionOptionValues) UpdateEnvironment() OptionValue[SparseArray[string]]

UpdateEnvironment returns the "update-environment" session option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetUpdateEnvironment or GlobalSessionScope.SetUpdateEnvironment. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (SessionOptionValues) VisualActivity

func (v SessionOptionValues) VisualActivity() OptionValue[VisualActivity]

VisualActivity returns the "visual-activity" session option value as OptionValue with Go value shape OptionValue[VisualActivity]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "both"). Set it with Session.SetVisualActivity or GlobalSessionScope.SetVisualActivity. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) VisualBell

func (v SessionOptionValues) VisualBell() OptionValue[VisualBell]

VisualBell returns the "visual-bell" session option value as OptionValue with Go value shape OptionValue[VisualBell]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "both"). Set it with Session.SetVisualBell or GlobalSessionScope.SetVisualBell. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) VisualSilence

func (v SessionOptionValues) VisualSilence() OptionValue[VisualSilence]

VisualSilence returns the "visual-silence" session option value as OptionValue with Go value shape OptionValue[VisualSilence]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "both"). Set it with Session.SetVisualSilence or GlobalSessionScope.SetVisualSilence. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

func (SessionOptionValues) WordSeparators

func (v SessionOptionValues) WordSeparators() OptionValue[string]

WordSeparators returns the "word-separators" session option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Session.SetWordSeparators or GlobalSessionScope.SetWordSeparators. Use Session.RawOption or GlobalSessionScope.RawOption for caller-named or undecoded values. It is not a style option.

type SetArrayResult

type SetArrayResult struct {
	// Replaced reports whether tmux confirmed the base replacement.
	Replaced bool
	// AppliedIndices lists confirmed indexed writes in ascending order.
	AppliedIndices []int
}

SetArrayResult reports confirmed progress from a typed sparse-array replacement. AppliedIndices is caller-owned and is non-nil whenever mutation was attempted.

type SetBufferRequest

type SetBufferRequest struct {
	// Data is the exact buffer data to store or append.
	Data string
	// Name selects a named buffer, or nil for tmux's most-recent buffer.
	Name *string
	// Append appends Data instead of replacing the selected buffer.
	Append bool
}

SetBufferRequest configures storing data in a tmux paste buffer. Its zero value writes an empty most-recent buffer; nil Name selects that buffer while a pointer to an empty name is explicit.

type SetClipboard

type SetClipboard string

SetClipboard is a typed value for the "set-clipboard" tmux option. Its zero value is invalid.

const (
	// SetClipboardOff selects "off".
	SetClipboardOff SetClipboard = "off"
	// SetClipboardExternal selects "external".
	SetClipboardExternal SetClipboard = "external"
	// SetClipboardOn selects "on".
	SetClipboardOn SetClipboard = "on"
)

func (SetClipboard) String

func (v SetClipboard) String() string

String returns the exact tmux spelling of v.

func (SetClipboard) Valid

func (v SetClipboard) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type SetEnvironmentOptions

type SetEnvironmentOptions struct {
	// ExpandFormat expands tmux format expressions in Value before storing it.
	ExpandFormat bool
	// Hidden keeps the value available to tmux but out of child environments.
	Hidden bool
}

SetEnvironmentOptions controls tmux's value expansion and visibility flags. Its zero value stores Value literally and exposes it to child processes.

type SetHooksOptions

type SetHooksOptions struct {
	// ClearExisting unsets every existing index before applying Values.
	ClearExisting bool
}

SetHooksOptions controls a bulk hook replacement. Its zero value preserves existing indices before applying the supplied sparse values.

type SetHooksResult

type SetHooksResult struct {
	// Cleared reports that all existing hook indices were confirmed cleared.
	Cleared bool
	// AppliedIndices is an owned ascending list of indices confirmed applied.
	AppliedIndices []int
}

SetHooksResult reports only side effects confirmed before return.

type SetOptionOptions

type SetOptionOptions struct {
	// ExpandFormat expands tmux formats in the value before storing it.
	ExpandFormat bool
	// PreventOverwrite leaves an existing option unchanged.
	PreventOverwrite bool
	// Quiet suppresses tmux's missing-option diagnostic.
	Quiet bool
}

SetOptionOptions controls set-option mutation flags. Its zero value sends no optional mutation flags.

type SetPlanOptionRequest

type SetPlanOptionRequest struct {
	// Name is the tmux option name, such as "status" or a user option "@thing".
	Name string
	// Value is the value to write. It is omitted when Unset is set.
	Value string
	// Global writes the server or global scope rather than the target's own.
	Global bool
	// Window writes a window option rather than a session or server one.
	Window bool
	// Pane writes a pane option.
	Pane bool
	// Unset removes the option instead of writing it.
	Unset bool
	// Append adds to an existing value rather than replacing it.
	Append bool
}

SetPlanOptionRequest names one tmux option write for Plan.SetOption. Its zero value is invalid, because Name is required.

type ShowMessagesRequest

type ShowMessagesRequest struct {
	// TargetClient selects a stable client; zero selects tmux's current client.
	TargetClient ClientName
	// Terminals includes terminal capability information.
	Terminals bool
	// Jobs includes job status information.
	Jobs bool
}

ShowMessagesRequest selects the target and server information to print. Terminals and Jobs are independent and may both be enabled.

type SilenceAction

type SilenceAction string

SilenceAction is a typed value for the "silence-action" tmux option. Its zero value is invalid.

const (
	// SilenceActionNone selects "none".
	SilenceActionNone SilenceAction = "none"
	// SilenceActionAny selects "any".
	SilenceActionAny SilenceAction = "any"
	// SilenceActionCurrent selects "current".
	SilenceActionCurrent SilenceAction = "current"
	// SilenceActionOther selects "other".
	SilenceActionOther SilenceAction = "other"
)

func (SilenceAction) String

func (v SilenceAction) String() string

String returns the exact tmux spelling of v.

func (SilenceAction) Valid

func (v SilenceAction) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

Snapshot is an immutable, observational view of one tmux server. It is normally returned by Server.Snapshot. Its zero value has a zero Version, a zero Server, non-nil empty collection slices, and not-found point lookups. Accessors never query tmux; returned slices are newly allocated and their contained records are shallow copies.

func (Snapshot) ClientByName

func (s Snapshot) ClientByName(name ClientName) (Client, error)

ClientByName returns the sole client view with name. It never queries tmux and returns a SnapshotLookupError matching ErrSnapshotNotFound or ErrSnapshotAmbiguous when cardinality is not one.

func (Snapshot) Clients

func (s Snapshot) Clients() []Client

Clients returns a newly allocated shallow copy of materialized clients. It never queries tmux.

func (Snapshot) ClientsSeq

func (s Snapshot) ClientsSeq() iter.Seq[Client]

ClientsSeq returns an iterator over materialized client values. It never queries tmux.

func (Snapshot) PaneByID

func (s Snapshot) PaneByID(id PaneID) (Pane, error)

PaneByID returns the sole pane view with id. Linked-session views can make an ID ambiguous, so it can return a SnapshotLookupError matching ErrSnapshotAmbiguous. It never queries tmux.

func (Snapshot) Panes

func (s Snapshot) Panes() []Pane

Panes returns a newly allocated shallow copy of pane views for every winlink. It never queries tmux.

func (Snapshot) PanesByID

func (s Snapshot) PanesByID(id PaneID) []Pane

PanesByID returns newly allocated shallow copies of every pane view with id. It never queries tmux.

func (Snapshot) PanesSeq

func (s Snapshot) PanesSeq() iter.Seq[Pane]

PanesSeq returns an iterator over materialized pane-view values. It never queries tmux.

func (Snapshot) Server

func (s Snapshot) Server() Server

Server returns the configured handle that produced this snapshot. The zero Snapshot returns a zero Server.

func (Snapshot) SessionByID

func (s Snapshot) SessionByID(id SessionID) (Session, error)

SessionByID returns the sole session view with id. It never queries tmux and returns a SnapshotLookupError matching ErrSnapshotNotFound otherwise.

func (Snapshot) Sessions

func (s Snapshot) Sessions() []Session

Sessions returns a newly allocated shallow copy of materialized sessions. It never queries tmux.

func (Snapshot) SessionsSeq

func (s Snapshot) SessionsSeq() iter.Seq[Session]

SessionsSeq returns an iterator over materialized session values. It never queries tmux.

func (Snapshot) Version

func (s Snapshot) Version() Version

Version returns the tmux version that selected this snapshot's format fields. The zero Snapshot returns a zero Version.

func (Snapshot) WindowByID

func (s Snapshot) WindowByID(id WindowID) (Window, error)

WindowByID returns the sole winlink view with id. Linked sessions can make an ID ambiguous, so it can return a SnapshotLookupError matching ErrSnapshotAmbiguous. It never queries tmux.

func (Snapshot) Windows

func (s Snapshot) Windows() []Window

Windows returns a newly allocated shallow copy with one view per winlink. It never queries tmux.

func (Snapshot) WindowsByID

func (s Snapshot) WindowsByID(id WindowID) []Window

WindowsByID returns newly allocated shallow copies of every winlink view with id. It never queries tmux.

func (Snapshot) WindowsSeq

func (s Snapshot) WindowsSeq() iter.Seq[Window]

WindowsSeq returns an iterator over materialized winlink values. It never queries tmux.

type SnapshotDecodeError

type SnapshotDecodeError struct {
	// Object names the tmux object whose listing contained the record.
	Object string
	// Record is the one-based physical record number in that listing.
	Record int
	// Field names the required format field that could not be decoded.
	Field string
	// Value is redacted for library-created errors because snapshot fields may
	// contain pane output, commands, paths, or other caller data.
	Value string
	// Reason describes why the field was malformed.
	Reason string
}

SnapshotDecodeError identifies one malformed decoded list row. It matches ErrMalformedSnapshot through errors.Is; callers can recover its redacted location fields with errors.As.

func (*SnapshotDecodeError) Error

func (e *SnapshotDecodeError) Error() string

Error implements error.

func (*SnapshotDecodeError) Unwrap

func (e *SnapshotDecodeError) Unwrap() error

Unwrap makes SnapshotDecodeError compatible with ErrMalformedSnapshot.

type SnapshotLookupError

type SnapshotLookupError struct {
	// Object names the requested snapshot object kind.
	Object string
	// Identifier is the requested stable identifier.
	Identifier string
	// Matches is the number of matching materialized views.
	Matches int
}

SnapshotLookupError reports the cardinality of an unsuccessful point lookup. It matches ErrSnapshotNotFound or ErrSnapshotAmbiguous through errors.Is; callers can recover its target and count with errors.As.

func (*SnapshotLookupError) Error

func (e *SnapshotLookupError) Error() string

Error implements error.

func (*SnapshotLookupError) Unwrap

func (e *SnapshotLookupError) Unwrap() error

Unwrap classifies the failed lookup by cardinality.

type SourceFileRequest

type SourceFileRequest struct {
	// Path is the required configuration path; exact "-" is rejected because no stdin is provided.
	Path string
	// Quiet suppresses tmux diagnostics for missing source files.
	Quiet bool
	// ParseOnly validates the file without applying its commands.
	ParseOnly bool
	// Verbose requests tmux parsing diagnostics.
	Verbose bool
}

SourceFileRequest configures loading or parsing a tmux configuration file. Its zero value is invalid because Path is required; SourceFile expands only the current user's ~ forms and copies no caller-owned mutable input.

type SparseArray

type SparseArray[T any] struct {
	// contains filtered or unexported fields
}

SparseArray stores values at sorted, nonnegative indices. Its zero value is an empty array. Constructors and functional updates own their entry slices; copies of reference-bearing T values remain shallow.

Example
package main

import (
	"fmt"

	"github.com/libtmux/libtmux-go/tmux"
)

func main() {
	values, err := tmux.NewSparseArray(
		tmux.SparseEntry[string]{Index: 1, Value: "first"},
		tmux.SparseEntry[string]{Index: 4, Value: "fourth"},
	)
	if err != nil {
		return
	}

	value, present := values.Get(2)
	fmt.Println(values.Indices())
	fmt.Println(value, present)
}
Output:
[1 4]
 false

func NewSparseArray

func NewSparseArray[T any](entries ...SparseEntry[T]) (SparseArray[T], error)

NewSparseArray builds an array from entries, sorting them by index. It returns errors matching ErrInvalidSparseIndex or ErrDuplicateSparseIndex for negative, overflowing, or duplicate indices.

func (SparseArray[T]) All

func (a SparseArray[T]) All() iter.Seq2[int, T]

All returns an iterator over indices and values in ascending index order.

func (SparseArray[T]) Append

func (a SparseArray[T]) Append(value T) (SparseArray[T], error)

Append returns a copy with value stored after the highest present index. It leaves the receiver unchanged and returns an error matching ErrInvalidSparseIndex when that index overflows.

func (SparseArray[T]) Entries

func (a SparseArray[T]) Entries() []SparseEntry[T]

Entries returns a fresh shallow copy in ascending index order.

func (SparseArray[T]) Get

func (a SparseArray[T]) Get(index int) (T, bool)

Get returns the value at index and reports whether it is present. A missing index, including a sparse hole, returns the zero value and false.

func (SparseArray[T]) Indices

func (a SparseArray[T]) Indices() []int

Indices returns a fresh slice of present indices in ascending order.

func (SparseArray[T]) Len

func (a SparseArray[T]) Len() int

Len returns the number of present entries, not the highest index.

func (SparseArray[T]) Values

func (a SparseArray[T]) Values() []T

Values returns a fresh shallow slice in ascending index order.

func (SparseArray[T]) With

func (a SparseArray[T]) With(index int, value T) (SparseArray[T], error)

With returns a copy with value inserted or replaced at index. It leaves the receiver unchanged and returns an error matching ErrInvalidSparseIndex for a negative index.

type SparseEntry

type SparseEntry[T any] struct {
	// Index is the nonnegative sparse-array index.
	Index int
	// Value is the value stored at Index.
	Value T
}

SparseEntry is one indexed SparseArray value.

type SplitPaneRequest

type SplitPaneRequest struct {
	// Attach lets the created pane become active in the exact target winlink;
	// false preserves its active pane.
	Attach bool
	// Direction selects the side of the target; zero means below.
	Direction PaneDirection
	// Size selects a nonnegative absolute pane size; nil omits it.
	Size *int
	// Percentage selects a size from 0 through 100; nil omits it. It is sent
	// as tmux's "-l N%", which every supported version accepts; the older -p
	// spelling is rejected by tmux 3.4.
	Percentage *int
	// StartDirectory expands ~ and ~/... for the current user. Named-user
	// forms such as ~other are rejected; empty inherits tmux's default.
	StartDirectory string
	// Command starts the pane with this shell command; empty uses tmux's default.
	Command string
	// FullWindow lets the new pane span the full window size.
	FullWindow bool
	// Zoom preserves the window's zoomed state after the split.
	Zoom bool
	// Environment is emitted in lexically sorted key order and is not retained;
	// nil and an empty map both add no entries.
	Environment map[string]string
	// Empty requests an empty pane on tmux 3.7 or later.
	Empty bool
	// Style sets the pane style on tmux 3.7 or later; nil omits it.
	Style *string
	// ActiveBorderStyle sets the active border style on tmux 3.7 or later; nil
	// omits it.
	ActiveBorderStyle *string
	// InactiveBorderStyle sets the inactive border style on tmux 3.7 or later;
	// nil omits it.
	InactiveBorderStyle *string
	// Message sets the pane message on tmux 3.7 or later; nil omits it.
	Message *string
	// Keep preserves the pane after its command exits on tmux 3.7 or later.
	Keep bool
}

SplitPaneRequest configures tiled pane creation on tmux 3.2a or later. Its zero value creates a detached pane below the exact target with tmux's default size and command. Nil pointer fields omit their options; nonnil pointers are explicit, including empty style or message strings. Size and Percentage are mutually exclusive. Invalid values are rejected before tmux is mutated.

Window.SplitPane and Pane.Split copy every pointer and Environment before validation or a compatibility probe and retain none of that storage. Mutation after the copy completes cannot affect the call, but mutation during the copy is not race-safe. Empty and the style, border, message, and Keep group require tmux 3.7. On older supported versions each requested group synchronously reaches WarningHandler and is omitted. Empty and Command are checked for mutual exclusion after that probe, so an unsupported Empty can be omitted while Command still runs.

type Status

type Status string

Status is a typed value for the "status" tmux option. Its zero value is invalid.

const (
	// StatusOff selects "off".
	StatusOff Status = "off"
	// StatusOn selects "on".
	StatusOn Status = "on"
	// Status2 selects "2".
	Status2 Status = "2"
	// Status3 selects "3".
	Status3 Status = "3"
	// Status4 selects "4".
	Status4 Status = "4"
	// Status5 selects "5".
	Status5 Status = "5"
)

func (Status) String

func (v Status) String() string

String returns the exact tmux spelling of v.

func (Status) Valid

func (v Status) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type StatusJustify

type StatusJustify string

StatusJustify is a typed value for the "status-justify" tmux option. Its zero value is invalid.

const (
	// StatusJustifyLeft selects "left".
	StatusJustifyLeft StatusJustify = "left"
	// StatusJustifyCentre selects "centre".
	StatusJustifyCentre StatusJustify = "centre"
	// StatusJustifyRight selects "right".
	StatusJustifyRight StatusJustify = "right"
	// StatusJustifyAbsoluteCentre selects "absolute-centre".
	StatusJustifyAbsoluteCentre StatusJustify = "absolute-centre"
)

func (StatusJustify) String

func (v StatusJustify) String() string

String returns the exact tmux spelling of v.

func (StatusJustify) Valid

func (v StatusJustify) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type StatusKeys

type StatusKeys string

StatusKeys is a typed value for the "status-keys" tmux option. Its zero value is invalid.

const (
	// StatusKeysEmacs selects "emacs".
	StatusKeysEmacs StatusKeys = "emacs"
	// StatusKeysVi selects "vi".
	StatusKeysVi StatusKeys = "vi"
)

func (StatusKeys) String

func (v StatusKeys) String() string

String returns the exact tmux spelling of v.

func (StatusKeys) Valid

func (v StatusKeys) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type StatusPosition

type StatusPosition string

StatusPosition is a typed value for the "status-position" tmux option. Its zero value is invalid.

const (
	// StatusPositionTop selects "top".
	StatusPositionTop StatusPosition = "top"
	// StatusPositionBottom selects "bottom".
	StatusPositionBottom StatusPosition = "bottom"
)

func (StatusPosition) String

func (v StatusPosition) String() string

String returns the exact tmux spelling of v.

func (StatusPosition) Valid

func (v StatusPosition) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type SwapPaneDirection

type SwapPaneDirection uint8

SwapPaneDirection selects an adjacent pane for swap-pane on tmux 3.2a or later. Its zero value selects no adjacent pane.

const (
	// SwapPaneDirectionNone selects no adjacent pane.
	SwapPaneDirectionNone SwapPaneDirection = iota
	// SwapPaneDirectionUp swaps with the previous pane in index order.
	SwapPaneDirectionUp
	// SwapPaneDirectionDown swaps with the next pane in index order.
	SwapPaneDirectionDown
)

Supported adjacent-pane swap directions.

type SwapPaneRequest

type SwapPaneRequest struct {
	// Target selects an exact other pane; a zero Pane omits it.
	Target Pane
	// Direction selects an adjacent pane; zero omits it.
	Direction SwapPaneDirection
	// Detach leaves the active-pane selection unchanged.
	Detach bool
	// KeepZoom preserves the affected window's zoomed state.
	KeepZoom bool
}

SwapPaneRequest configures swapping with an exact or adjacent pane on tmux 3.2a or later. Its zero value is invalid: exactly one complete Target or Direction is required. An explicit Target must differ from the receiver and must be proven to share a daemon through connection state or the same nonempty SocketPath; matching socket names alone are insufficient. Invalid choices are rejected before execution. Request values are copied for the call and retained nowhere.

type SwapWindowRequest

type SwapWindowRequest struct {
	// Target is the exact other winlink to swap with the receiver.
	Target Window
	// Detach leaves the affected sessions' current-window selection unchanged.
	Detach bool
}

SwapWindowRequest configures swapping the receiver with one exact winlink on tmux 3.2a or later. Its zero value is invalid because Target must be a complete Window handle. The endpoints must be proven to share a daemon through connection state or the same nonempty SocketPath; matching socket names alone are insufficient. Handles are copied for the call and retained nowhere. Validation completes before execution.

type TargetError

type TargetError struct {
	// Object names the tmux object kind whose target was validated.
	Object string
	// Target is the submitted target text.
	Target string
}

TargetError reports a malformed stable identifier before command execution. It matches ErrInvalidTarget through errors.Is; callers can recover Object and Target with errors.As.

func (*TargetError) Error

func (e *TargetError) Error() string

Error implements error.

func (*TargetError) Unwrap

func (e *TargetError) Unwrap() error

Unwrap makes TargetError compatible with ErrInvalidTarget.

type TerminalCapability

type TerminalCapability struct {
	// Name is the capability name.
	Name string
	// Value is the parsed capability value.
	Value TerminalOverrideValue
}

TerminalCapability is one parsed terminal override capability.

type TerminalFeature

type TerminalFeature struct {
	// Terminal is the terminal pattern.
	Terminal string
	// Features is an owned feature list for Terminal.
	Features []string
}

TerminalFeature is one terminal pattern and its enabled features.

type TerminalFeatures

type TerminalFeatures struct {
	// contains filtered or unexported fields
}

TerminalFeatures is an immutable parsed terminal-features option. Its zero value is an empty collection: Len is zero, Lookup reports false, and Entries returns a nonnil empty slice.

func (TerminalFeatures) Entries

func (f TerminalFeatures) Entries() []TerminalFeature

Entries returns a deep fresh copy in first-definition order.

func (TerminalFeatures) Len

func (f TerminalFeatures) Len() int

Len returns the number of distinct terminal patterns.

func (TerminalFeatures) Lookup

func (f TerminalFeatures) Lookup(terminal string) ([]string, bool)

Lookup returns a fresh feature slice for terminal.

type TerminalOverride

type TerminalOverride struct {
	// contains filtered or unexported fields
}

TerminalOverride is the immutable capability set for one terminal pattern. Its zero value is an empty immutable collection: Len is zero, Lookup reports false, and Entries returns a nonnil empty slice.

func (TerminalOverride) Entries

func (o TerminalOverride) Entries() []TerminalCapability

Entries returns a fresh slice in first-definition order.

func (TerminalOverride) Len

func (o TerminalOverride) Len() int

Len returns the number of distinct capabilities.

func (TerminalOverride) Lookup

Lookup returns one capability value.

type TerminalOverrideEntry

type TerminalOverrideEntry struct {
	// Terminal is the terminal pattern.
	Terminal string
	// Capabilities is the immutable capability set for Terminal.
	Capabilities TerminalOverride
}

TerminalOverrideEntry is one terminal pattern and its parsed capabilities.

type TerminalOverrideValue

type TerminalOverrideValue struct {
	// contains filtered or unexported fields
}

TerminalOverrideValue is a flag, arbitrary-precision integer, or string. Its zero value has no recognized kind: IsFlag is false, Integer and Text report false, and it represents no parsed capability assignment.

func (TerminalOverrideValue) Integer

func (v TerminalOverrideValue) Integer() (*big.Int, bool)

Integer returns a fresh arbitrary-precision integer when the value is numeric.

func (TerminalOverrideValue) IsFlag

func (v TerminalOverrideValue) IsFlag() bool

IsFlag reports whether the capability has no assigned value.

func (TerminalOverrideValue) Kind

Kind returns the value's closed form.

func (TerminalOverrideValue) Text

func (v TerminalOverrideValue) Text() (string, bool)

Text returns the assigned string when the value is textual.

type TerminalOverrideValueKind

type TerminalOverrideValueKind uint8

TerminalOverrideValueKind identifies one closed terminal capability value form.

const (
	// TerminalOverrideValueFlag identifies a capability without an assigned value.
	TerminalOverrideValueFlag TerminalOverrideValueKind = iota + 1
	// TerminalOverrideValueInteger identifies an unsigned decimal integer.
	TerminalOverrideValueInteger
	// TerminalOverrideValueText identifies an assigned non-integer string.
	TerminalOverrideValueText
)

type TerminalOverrides

type TerminalOverrides struct {
	// contains filtered or unexported fields
}

TerminalOverrides is an immutable parsed terminal-overrides option. Its zero value is an empty immutable collection: Len is zero, Lookup reports false, and Entries returns a nonnil empty slice.

func (TerminalOverrides) Entries

Entries returns a fresh outer slice in first-definition order. Nested TerminalOverride values remain immutable.

func (TerminalOverrides) Len

func (o TerminalOverrides) Len() int

Len returns the number of distinct terminal patterns.

func (TerminalOverrides) Lookup

func (o TerminalOverrides) Lookup(terminal string) (TerminalOverride, bool)

Lookup returns the capabilities for terminal.

type TmuxFilter

type TmuxFilter string

TmuxFilter is a raw tmux -f format expression. It is distinct from the generated local filter structs and is evaluated only by tmux. A nil filter omits -f; a nonnil empty filter sends an explicit empty expression.

The expression is tmux's own, so it is written the way tmux's FORMATS section describes rather than built from Go values:

active := tmux.TmuxFilter("#{==:#{window_active},1}")
windows, err := session.SearchWindows(ctx, &active)

tmux evaluates it while listing, so a filter written this way narrows what tmux sends back. The generated PaneFilter and WindowFilter types are the other half of the pair: they are evaluated in Go, after everything has been listed, and are the ones to reach for when the test is easier to write in Go than in a tmux format.

type TreeSortOrder

type TreeSortOrder uint8

TreeSortOrder selects one initial tmux choose-tree ordering. Its zero value leaves tmux's configured ordering unchanged.

const (
	// TreeSortDefault leaves the configured choose-tree ordering unchanged.
	TreeSortDefault TreeSortOrder = iota
	// TreeSortIndex orders tree entries by index.
	TreeSortIndex
	// TreeSortName orders tree entries by name.
	TreeSortName
	// TreeSortTime orders tree entries by activity time.
	TreeSortTime
	// TreeSortSize orders tree entries by size.
	TreeSortSize
)

type UnbindKeyRequest

type UnbindKeyRequest struct {
	// Key selects one binding; it is mutually exclusive with AllKeys.
	Key *string
	// KeyTable limits removal to one table; nil selects tmux's default table.
	KeyTable *string
	// AllKeys removes every binding in KeyTable and is mutually exclusive with Key.
	AllKeys bool
	// Quiet suppresses tmux's missing-binding diagnostic.
	Quiet bool
}

UnbindKeyRequest selects one key or an entire key table to unbind. Exactly one of Key and AllKeys must be set.

type UnlinkWindowRequest

type UnlinkWindowRequest struct {
	// KillIfLast permits unlinking and destroying a stable window with no other
	// links.
	KillIfLast bool
}

UnlinkWindowRequest configures unlinking one exact winlink on tmux 3.2a or later. Its zero value removes the link only when the stable window has another link. The request contains no retained caller-owned storage and has no invalid field combinations.

type UnsetOptionOptions

type UnsetOptionOptions struct {
	// UnsetPanes unsets a window option on every pane in a Window receiver.
	UnsetPanes bool
	// Quiet suppresses tmux's missing-option diagnostic.
	Quiet bool
}

UnsetOptionOptions controls set-option unset behavior. Its zero value unsets only the selected option.

type UnsupportedPolicy

type UnsupportedPolicy uint8

UnsupportedPolicy selects what a request does when it needs an optional tmux capability the running server does not have — a flag added in a later tmux than the one answering.

The default refuses, because dropping a flag changes what the command does. A split asked to leave a pane empty otherwise starts a shell in it, a run-shell asked for arguments runs without them, and a kill-session asked for a session group takes one session instead of the group. Each returns success while doing something the caller did not ask for.

Choosing degradation is how a program stays portable across the supported tmux range when the capability is cosmetic and its absence is acceptable:

server := tmux.NewServer(tmux.ServerOptions{
	Unsupported:    tmux.DegradeUnsupported,
	WarningHandler: func(w tmux.Warning) { log.Printf("tmux: %s", w) },
})

Set ServerOptions.WarningHandler alongside it. Degradation with no handler is the silence this setting exists to make deliberate.

const (
	// FailUnsupported refuses a request naming a capability the running tmux
	// does not have, with a VersionTooLowError naming the subcommand and the
	// capability. It is the zero value.
	FailUnsupported UnsupportedPolicy = iota
	// DegradeUnsupported omits the capability, runs the reduced command, and
	// reports the decision to ServerOptions.WarningHandler as a
	// WarningUnsupportedFeature.
	DegradeUnsupported
)

func (UnsupportedPolicy) String

func (p UnsupportedPolicy) String() string

String implements fmt.Stringer.

type Version

type Version struct {
	// contains filtered or unexported fields
}

Version is a parsed tmux version that preserves its original token. Obtain a value with ParseVersion, Server.Version, or Snapshot.Version. Its zero value has no feature level and is useful only as an absent version. Parsed OpenBSD base-system tokens also have no feature level until Server.Version probes the configured binary's commands.

func ParseVersion

func ParseVersion(raw string) (Version, error)

ParseVersion parses a raw tmux version token. It returns a VersionError matching ErrInvalidVersion when the token cannot be parsed.

func (Version) AtLeast

func (v Version) AtLeast(minimum Version) bool

AtLeast reports whether v provides the same or a newer feature level.

func (Version) Compare

func (v Version) Compare(other Version) int

Compare compares numeric feature levels and returns -1, 0, or 1. Release qualifiers other than master do not change the feature level.

func (Version) CompareRelease

func (v Version) CompareRelease(other Version) int

CompareRelease compares raw release suffixes using libtmux's legacy order. Use Compare for feature gates, where point-release suffixes intentionally share one capability level.

func (Version) Major

func (v Version) Major() int

Major returns the capability-level major component. Development tokens use the latest tested feature core. Unprobed OpenBSD base-system tokens return zero.

func (Version) Minor

func (v Version) Minor() int

Minor returns the capability-level minor component, or zero when absent. Development tokens use the latest tested feature core. Unprobed OpenBSD base-system tokens return zero.

func (Version) Patch

func (v Version) Patch() int

Patch returns the capability-level patch component, or zero when absent.

func (Version) String

func (v Version) String() string

String returns the original tmux version token.

type VersionError

type VersionError struct {
	// Token is the rejected tmux version text.
	Token string
}

VersionError reports a tmux version token that cannot be parsed. It matches ErrInvalidVersion through errors.Is; callers can recover Token with errors.As.

func (*VersionError) Error

func (e *VersionError) Error() string

Error implements error.

func (*VersionError) Unwrap

func (e *VersionError) Unwrap() error

Unwrap makes VersionError compatible with ErrInvalidVersion.

type VersionQueryError

type VersionQueryError struct {
	// Result contains the library-created error's exit code and no diagnostics.
	Result CommandResult
	// Reason describes a malformed successful probe result, when applicable.
	Reason string
	// contains filtered or unexported fields
}

VersionQueryError reports an unsuccessful tmux -V probe. It matches ErrVersionQuery through errors.Is; callers can recover its fields with errors.As. Library-created errors retain only the exit code; command arguments and output are omitted, although callers may construct values with other contents.

func (*VersionQueryError) Error

func (e *VersionQueryError) Error() string

Error implements error.

func (*VersionQueryError) Unwrap

func (e *VersionQueryError) Unwrap() error

Unwrap makes VersionQueryError compatible with ErrVersionQuery.

type VersionTooLowError

type VersionTooLowError struct {
	// Current is the installed tmux feature level.
	Current Version
	// Minimum is the requested minimum feature level.
	Minimum Version
	// Subcommand names the tmux subcommand whose optional capability was
	// refused. Empty when the command itself is below its floor.
	Subcommand string
	// Feature names the refused optional capability. Empty when the command
	// itself is below its floor.
	Feature string
}

VersionTooLowError reports the installed and required tmux feature levels. It matches ErrVersionTooLow through errors.Is; callers can recover its fields with errors.As.

Subcommand and Feature are set when one optional capability within a command was refused rather than the command itself, which is what UnsupportedPolicy governs.

func (*VersionTooLowError) Error

func (e *VersionTooLowError) Error() string

Error implements error.

func (*VersionTooLowError) Unwrap

func (e *VersionTooLowError) Unwrap() error

Unwrap makes VersionTooLowError compatible with ErrVersionTooLow.

type VisualActivity

type VisualActivity string

VisualActivity is a typed value for the "visual-activity" tmux option. Its zero value is invalid.

const (
	// VisualActivityOff selects "off".
	VisualActivityOff VisualActivity = "off"
	// VisualActivityOn selects "on".
	VisualActivityOn VisualActivity = "on"
	// VisualActivityBoth selects "both".
	VisualActivityBoth VisualActivity = "both"
)

func (VisualActivity) String

func (v VisualActivity) String() string

String returns the exact tmux spelling of v.

func (VisualActivity) Valid

func (v VisualActivity) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type VisualBell

type VisualBell string

VisualBell is a typed value for the "visual-bell" tmux option. Its zero value is invalid.

const (
	// VisualBellOff selects "off".
	VisualBellOff VisualBell = "off"
	// VisualBellOn selects "on".
	VisualBellOn VisualBell = "on"
	// VisualBellBoth selects "both".
	VisualBellBoth VisualBell = "both"
)

func (VisualBell) String

func (v VisualBell) String() string

String returns the exact tmux spelling of v.

func (VisualBell) Valid

func (v VisualBell) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type VisualSilence

type VisualSilence string

VisualSilence is a typed value for the "visual-silence" tmux option. Its zero value is invalid.

const (
	// VisualSilenceOff selects "off".
	VisualSilenceOff VisualSilence = "off"
	// VisualSilenceOn selects "on".
	VisualSilenceOn VisualSilence = "on"
	// VisualSilenceBoth selects "both".
	VisualSilenceBoth VisualSilence = "both"
)

func (VisualSilence) String

func (v VisualSilence) String() string

String returns the exact tmux spelling of v.

func (VisualSilence) Valid

func (v VisualSilence) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type WaitForMode

type WaitForMode uint8

WaitForMode selects one wait-for operation. The zero value waits until the channel is signaled.

const (
	// WaitForModeWait waits until another client signals Channel.
	WaitForModeWait WaitForMode = iota
	// WaitForModeSignal signals Channel and wakes waiters.
	WaitForModeSignal
	// WaitForModeLock acquires Channel's tmux mutex.
	WaitForModeLock
	// WaitForModeUnlock releases Channel's tmux mutex.
	WaitForModeUnlock
)

Supported wait-for operations.

type WaitForRequest

type WaitForRequest struct {
	// Channel names the tmux wait-for channel or mutex.
	Channel string
	// Mode selects the channel action; zero waits.
	Mode WaitForMode
}

WaitForRequest configures a wait, signal, lock, or unlock operation. Its zero value waits on the required nonempty Channel.

type Warning

type Warning struct {
	// Kind classifies the compatibility decision.
	Kind WarningKind
	// Subcommand names the tmux subcommand affected by the decision.
	Subcommand string
	// Feature names the optional tmux capability involved.
	Feature string
	// CurrentVersion is the observed tmux version.
	CurrentVersion Version
	// RequiredVersion is the minimum tmux version for Feature.
	RequiredVersion Version
	// Message describes the nonfatal compatibility decision.
	Message string
}

Warning describes one nonfatal compatibility decision delivered to a WarningHandler.

func (Warning) String

func (w Warning) String() string

String implements fmt.Stringer, so a warning can be logged or printed without a caller reaching for a field. It reports the message, which already names the subcommand and the decision.

type WarningHandler

type WarningHandler func(Warning)

WarningHandler receives warnings synchronously on the operation's caller goroutine. It is a function type rather than an interface, so a handler is written as a literal and needs no adapter:

tmux.NewServer(tmux.ServerOptions{
	WarningHandler: func(warning tmux.Warning) {
		log.Printf("tmux: %s", warning.Message)
	},
})

Server operations may invoke the handler concurrently; callers must synchronize any shared handler state. The library starts no goroutine for warning delivery. Command diagnostics may contain caller-supplied tmux arguments; the library delivers them only to this handler and does not log them.

type WarningKind

type WarningKind uint8

WarningKind identifies one closed class of nonfatal library warning.

const (
	// WarningUnsupportedFeature reports a requested feature omitted because
	// the connected tmux binary is too old.
	WarningUnsupportedFeature WarningKind = iota + 1
	// WarningCommandStderr reports stderr from a completed command whose Python
	// API treats the diagnostic as nonfatal.
	WarningCommandStderr
	// WarningControlPoolClosed reports a command that started a tmux process
	// because the control pool carrying it had been closed. The command ran
	// and its result is unchanged; only its cost is.
	WarningControlPoolClosed
	// WarningControlPoolUnused reports a command that started a tmux process
	// while a control pool was open on the same configuration, which happens
	// when the record issuing it was materialized before the pool existed and
	// so kept the handle it was made on. The command ran and its result is
	// unchanged; only its cost is.
	WarningControlPoolUnused
)

type Window

type Window struct {
	// contains filtered or unexported fields
}

Window is one materialized (session, index, window) winlink record. It is normally returned by Server.Snapshot, Server.Window, or Window.Refresh. A zero Window is not a usable tmux target.

func WindowFromEnv

func WindowFromEnv(ctx context.Context, environment map[string]string) (Window, error)

WindowFromEnv returns the window containing the pane identified by the environment. Nil reads the process environment; a nonnil empty map does not.

func (Window) Active

func (w Window) Active() (bool, bool)

Active returns a typed bool value and an ok result parsed from tmux #{window_active} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) ActiveClients

func (w Window) ActiveClients() (int, bool)

ActiveClients returns a typed int value and an ok result parsed from tmux #{window_active_clients} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) ActiveClientsList

func (w Window) ActiveClientsList() (string, bool)

ActiveClientsList returns a typed string value and an ok result parsed from tmux #{window_active_clients_list} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) ActivePane

func (w Window) ActivePane() (Pane, bool)

ActivePane returns the first active pane in this materialized winlink view. It never queries tmux; use Window.ResolveActivePane for live state.

func (Window) ActiveSessions

func (w Window) ActiveSessions() (int, bool)

ActiveSessions returns a typed int value and an ok result parsed from tmux #{window_active_sessions} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) ActiveSessionsList

func (w Window) ActiveSessionsList() (string, bool)

ActiveSessionsList returns a typed string value and an ok result parsed from tmux #{window_active_sessions_list} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Activity

func (w Window) Activity() (time.Time, bool)

Activity returns a typed time.Time value and an ok result parsed from tmux #{window_activity} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) ActivityFlag

func (w Window) ActivityFlag() (bool, bool)

ActivityFlag returns a typed bool value and an ok result parsed from tmux #{window_activity_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) AppendHook

func (w Window) AppendHook(ctx context.Context, name string, command string) error

AppendHook appends a window hook at this exact window target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the append.

func (Window) AppendOption

func (w Window) AppendOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

AppendOption appends to a window option at this exact window target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the append was not accepted.

func (Window) BellFlag

func (w Window) BellFlag() (bool, bool)

BellFlag returns a typed bool value and an ok result parsed from tmux #{window_bell_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Bigger

func (w Window) Bigger() (bool, bool)

Bigger returns a typed bool value and an ok result parsed from tmux #{window_bigger} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) CellHeight

func (w Window) CellHeight() (int, bool)

CellHeight returns a typed int value and an ok result parsed from tmux #{window_cell_height} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) CellWidth

func (w Window) CellWidth() (int, bool)

CellWidth returns a typed int value and an ok result parsed from tmux #{window_cell_width} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Cmd

func (w Window) Cmd(ctx context.Context, args ...string) (CommandResult, error)

Cmd executes a tmux subcommand targeted to the window's stable ID.

func (Window) DisplayMessage

func (w Window) DisplayMessage(
	ctx context.Context,
	request DisplayMessageRequest,
) ([]string, error)

DisplayMessage displays or prints a message at this window's exact target. Print returns an owned stdout slice even on a completed nonzero exit; completed stderr synchronously reaches the caller-goroutine WarningHandler as WarningCommandStderr. NoExpand may synchronously reach that handler before the reduced command runs and before this call returns; context cancellation does not prove display did not occur.

func (Window) EndFlag

func (w Window) EndFlag() (bool, bool)

EndFlag returns a typed bool value and an ok result parsed from tmux #{window_end_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Equal

func (w Window) Equal(other Window) bool

Equal reports whether two window records carry the same stable window ID. It intentionally collapses linked-session views with different sessions or indexes; use SessionID, WindowID, and WindowIndex for exact view identity.

func (Window) Flags

func (w Window) Flags() (string, bool)

Flags returns a typed string value and an ok result parsed from tmux #{window_flags} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Format

func (w Window) Format() (bool, bool)

Format returns a typed bool value and an ok result parsed from tmux #{window_format} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Formats

func (w Window) Formats() FormatValues

Formats returns this Window's read-only materialized tmux format values. It does not query tmux; use Server.Snapshot to obtain a fresh record.

func (Window) Height

func (w Window) Height() (int, bool)

Height returns a typed int value and an ok result parsed from tmux #{window_height} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Hooks

func (w Window) Hooks(ctx context.Context) (WindowHookValues, error)

Hooks returns a freshly decoded, caller-owned view of known hooks at this exact window target, including inherited values. The receiver's exact linked session context controls tmux format evaluation. A read failure is returned rather than answered with zero values.

func (Window) ID

func (w Window) ID() WindowID

ID returns the underlying stable tmux window identity.

func (Window) Index

func (w Window) Index() int

Index returns this window's index in its linked session. It returns -1 for a partial Window whose exact winlink has not been materialized.

func (Window) Kill

func (w Window) Kill(ctx context.Context) error

Kill destroys the stable window selected by the receiver's WindowID, removes all of its winlinks, and destroys its panes. Affected sessions preserve their current selection unless this window was current, in which case they select another. A session left without windows is destroyed and its clients are detached. The materialized receiver is not refreshed and no longer represents a live window. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Window) KillOthers

func (w Window) KillOthers(ctx context.Context) error

KillOthers destroys every other stable window selected through the receiver's exact session and leaves the receiver as that session's current and only window. Links in other sessions are not selected merely because they share the receiver's WindowID, but every selected stable window is removed from all sessions. Other affected sessions preserve their current selection unless a destroyed window was current, in which case they select another. A session left without windows is destroyed and detaches its clients. The receiver is not refreshed. A completed command is treated as an error only when tmux writes stderr, which returns a CommandError; a nonzero exit without stderr is ignored. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Window) LastFlag

func (w Window) LastFlag() (bool, bool)

LastFlag returns a typed bool value and an ok result parsed from tmux #{window_last_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) LastPane

func (w Window) LastPane(ctx context.Context, request LastPaneRequest) (Pane, error)

LastPane targets the receiver's exact winlink. Its zero request makes the previously active pane active without selecting the window in its session. With an Input mode, tmux changes the previous pane's input state without selecting it; the returned Pane is still the freshly materialized active pane in the receiver context.

A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Pane because the active view cannot be identified reliably without refresh.

func (Window) Layout

func (w Window) Layout() (string, bool)

Layout returns a typed string value and an ok result parsed from tmux #{window_layout} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (w Window) Link(ctx context.Context, request LinkWindowRequest) error

Link adds the stable window to TargetSession as another winlink, targeting the source through the receiver's exact session. Unless Detach is set, tmux makes the new link current in the target session; this is not a global client-focus guarantee. Link does not refresh or mutate the materialized source Window. A transport or context error can be delivery-ambiguous; the void result cannot carry the new winlink identity and no rollback is attempted.

func (Window) Linked

func (w Window) Linked() (bool, bool)

Linked returns a typed bool value and an ok result parsed from tmux #{window_linked} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) LinkedSessionCount

func (w Window) LinkedSessionCount() (int, bool)

LinkedSessionCount returns a typed int value and an ok result parsed from tmux #{window_linked_sessions} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) LinkedSessions

func (w Window) LinkedSessions() ([]Session, bool)

LinkedSessions returns newly allocated shallow copies of materialized sessions containing this window, and reports whether the receiver carries relations at all. It never queries tmux.

A winlink belongs to at least the session it is linked into, so a materialized window with no sessions does not exist; false is what an empty result would otherwise have to mean.

func (Window) LinkedSessionsList

func (w Window) LinkedSessionsList() (string, bool)

LinkedSessionsList returns a typed string value and an ok result parsed from tmux #{window_linked_sessions_list} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) MarkedFlag

func (w Window) MarkedFlag() (bool, bool)

MarkedFlag returns a typed bool value and an ok result parsed from tmux #{window_marked_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Move

func (w Window) Move(ctx context.Context, request MoveWindowRequest) (Window, error)

Move removes the receiver's exact winlink and places it in TargetSession, or renumbers the selected session when Renumber is set. Unless NoSelect is set, tmux makes the moved winlink current in the destination session; this is not a global client-focus guarantee. The stable WindowID does not by itself identify either linked view.

Move returns a canonical freshly materialized Window, which may use a different linked session than the destination. If the command succeeds but refresh fails, it returns the receiver with that error. Other command errors return a zero Window. A transport or context error can be delivery-ambiguous and no rollback is attempted.

func (Window) Name

func (w Window) Name() (string, bool)

Name returns a typed string value and an ok result parsed from tmux #{window_name} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) NewPane

func (w Window) NewPane(ctx context.Context, request NewPaneRequest) (Pane, error)

NewPane creates a floating pane in the receiver's exact winlink. Attach makes the new pane active in that session and winlink; it is not a global client-focus guarantee. The returned Pane is freshly materialized in the receiver SessionID and WindowID rather than by canonical ID-only refresh.

A transport or context error can be delivery-ambiguous and no rollback is attempted. If tmux printed a valid PaneID before that error, or exact refresh fails after creation, NewPane returns a partial Pane containing the receiver SessionID and WindowID and the new PaneID. Other failures return a zero Pane. See NewPaneRequest, ErrVersionTooLow, ErrInvalidCommandOutput, and CommandError.

func (Window) NewWindow

func (w Window) NewWindow(ctx context.Context, request NewWindowRequest) (Window, error)

NewWindow creates a window relative to the receiver's exact winlink. Set Direction to NewWindowDirectionAfter or NewWindowDirectionBefore for non-destructive relative creation. With the zero Direction, tmux targets the receiver's occupied index and normally returns a command error; KillExisting can destroy and replace that target. Attach changes the current window only in that target session. Index is rejected before execution because the receiver already supplies the target position. SelectExisting has no no-output recovery on this exact-target form; tmux must print the created WindowID.

The returned Window is freshly materialized in the receiver SessionID. A transport or context error can be delivery-ambiguous and no rollback is attempted. If tmux printed a valid identity before that error, or exact refresh fails after creation, NewWindow returns the receiver SessionID and new WindowID as a partial Window with an Index of -1; other failures return a zero Window.

func (Window) NextLayout

func (w Window) NextLayout(ctx context.Context) error

NextLayout applies the next preset layout to the receiver's exact winlink. It changes pane geometry without selecting or refreshing the window. A transport or context error can be delivery-ambiguous; the void result cannot carry partial state and no rollback is attempted.

func (Window) OffsetX

func (w Window) OffsetX() (int, bool)

OffsetX returns a typed int value and an ok result parsed from tmux #{window_offset_x} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) OffsetY

func (w Window) OffsetY() (int, bool)

OffsetY returns a typed int value and an ok result parsed from tmux #{window_offset_y} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Options

func (w Window) Options(ctx context.Context) (WindowOptionValues, error)

Options returns a freshly decoded, caller-owned view of known options at this exact window target, including inherited values. The receiver's exact linked session context controls tmux format evaluation. A read failure is returned rather than answered with zero values. Each returned accessor names the setter that writes it, so WindowOptionValues.MainPaneWidth pairs with Window.SetMainPaneWidth.

func (Window) PaneCount

func (w Window) PaneCount() (int, bool)

PaneCount returns a typed int value and an ok result parsed from tmux #{window_panes} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Panes

func (w Window) Panes() ([]Pane, bool)

Panes returns newly allocated shallow copies of panes for this exact winlink, and reports whether the receiver carries relations at all.

It never queries tmux. Server.Snapshot, the resolvers, and Session.NewWindow carry relations; a targeted point lookup and Window.Refresh do not, and report false rather than no panes. tmux destroys a window when its last pane closes, so a materialized window with no panes does not exist: false is the only thing an empty result could honestly mean, and this is where it is said. Use Window.SearchPanes with a nil filter for the window's current panes.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-window-panes",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	window, err := session.ResolveActiveWindow(ctx)
	if err != nil {
		fmt.Println("resolve window:", err)
		return
	}

	// Panes reads the record's own materialized state and never queries tmux.
	// The second result says whether the record carries relations at all, which
	// is the difference between "this window has no panes" -- a window tmux
	// would have destroyed -- and "this record cannot answer". A targeted point
	// lookup cannot; a resolver can.
	looked, err := server.Window(ctx, window.ID())
	if err != nil {
		fmt.Println("look up window:", err)
		return
	}
	lookedPanes, ok := looked.Panes()
	fmt.Println("from a point lookup:", len(lookedPanes), ok)

	resolvedPanes, ok := window.Panes()
	fmt.Println("from a resolver:", len(resolvedPanes), ok)

	// A snapshot materializes the whole hierarchy, so its records carry them.
	snapshot, err := server.Snapshot(ctx)
	if err != nil {
		fmt.Println("snapshot:", err)
		return
	}
	for _, materialized := range snapshot.Windows() {
		panes, ok := materialized.Panes()
		fmt.Println("from a snapshot:", len(panes), ok)
	}

	// A record that cannot answer still can, through tmux: SearchPanes asks.
	searched, err := looked.SearchPanes(ctx, nil)
	if err != nil {
		fmt.Println("search panes:", err)
		return
	}
	fmt.Println("from a search:", len(searched))
}
Output:
from a point lookup: 0 false
from a resolver: 1 true
from a snapshot: 1 true
from a search: 1

func (Window) PreviousLayout

func (w Window) PreviousLayout(ctx context.Context) error

PreviousLayout applies the previous preset layout to the receiver's exact winlink. It changes pane geometry without selecting or refreshing the window. A transport or context error can be delivery-ambiguous; the void result cannot carry partial state and no rollback is attempted.

func (Window) RawFlags

func (w Window) RawFlags() (string, bool)

RawFlags returns a typed string value and an ok result parsed from tmux #{window_raw_flags} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) RawHook

func (w Window) RawHook(ctx context.Context, name string) (string, bool, error)

RawHook returns one exact window hook value at this exact window target. A successful string is caller-owned; the receiver's exact linked session context controls tmux format evaluation, and completed failures are returned.

func (Window) RawOption

func (w Window) RawOption(ctx context.Context, name string) (string, bool, error)

RawOption returns one exact window option value at this exact window target. A successful string is caller-owned; the receiver's exact linked session context controls tmux format evaluation, and a completed failure is returned.

func (Window) Ref

func (w Window) Ref() Ref

Ref returns a Ref addressing the receiver.

func (Window) Refresh

func (w Window) Refresh(ctx context.Context) (Window, error)

Refresh performs a canonical live lookup for the window's stable ID and returns a new record without mutating the receiver. It does not preserve a linked-session view; use Window.ResolveSession for exact relationships. Canceling ctx stops this read-only lookup's local wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Window) Rename

func (w Window) Rename(ctx context.Context, name string) (Window, error)

Rename changes the stable window through the receiver's exact winlink and returns a canonical freshly materialized Window. The returned winlink may therefore use another session when the WindowID is linked. If the command succeeds but refresh fails, Rename returns the receiver with that error. A transport or context error can be delivery-ambiguous; no rollback is attempted.

func (Window) Resize

func (w Window) Resize(ctx context.Context, request ResizeWindowRequest) (Window, error)

Resize changes the stable window's size through the receiver's exact winlink. It does not select the window or promise any client focus. Resize returns a canonical freshly materialized Window, which may use another linked session for the same WindowID. If the command succeeds but refresh fails, it returns the receiver with that error; other command failures return a zero Window. A transport or context error can be delivery-ambiguous and no rollback is attempted.

func (Window) ResolveActivePane

func (w Window) ResolveActivePane(ctx context.Context) (Pane, bool, error)

ResolveActivePane snapshots live tmux state and returns the first active pane in this exact winlink view. A missing active pane returns ok false. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Window) ResolveSession

func (w Window) ResolveSession(ctx context.Context) (Session, error)

ResolveSession snapshots live tmux state and returns this exact winlink's parent session. It returns SnapshotLookupError cardinality errors. Canceling ctx stops this read-only snapshot wait; errors.Is can detect context.Canceled or context.DeadlineExceeded as applicable.

func (Window) Respawn

func (w Window) Respawn(ctx context.Context, request RespawnRequest) (Window, error)

Respawn restarts the stable window process through the receiver's exact winlink. It does not select the window or promise any client focus. Respawn returns a canonical freshly materialized Window, which may use another linked session for the same WindowID. If the command succeeds but refresh fails, it returns the receiver with that error; validation or transport failure returns a zero Window. A completed command is treated as an error only when tmux writes stderr, in which case Respawn returns a CommandError and a zero Window. A nonzero exit without stderr is ignored and refresh proceeds. A transport or context error can be delivery-ambiguous and no rollback is attempted.

func (Window) Rotate

func (w Window) Rotate(ctx context.Context, request RotateWindowRequest) (Window, error)

Rotate rotates pane positions in the receiver's exact winlink without selecting the window or promising client focus. It returns a freshly materialized exact Window preserving the receiver SessionID, rather than a canonical ID-only view. If the command succeeds but refresh fails, Rotate returns the receiver with that error; other command failures return a zero Window. A transport or context error can be delivery-ambiguous and no rollback is attempted.

func (Window) RunHook

func (w Window) RunHook(ctx context.Context, name string) error

RunHook asks tmux to run one window hook directly at this exact target. The receiver's exact linked session context controls tmux format evaluation; no racy preflight is issued. Completed failures are secret-safe option errors; cancellation does not prove execution did not occur.

func (Window) SearchPanes

func (w Window) SearchPanes(
	ctx context.Context,
	filter *TmuxFilter,
) ([]Pane, error)

SearchPanes returns this window's pane views selected by tmux's live -f expression. A nil filter omits -f and a nonnil empty filter sends an explicit expression. Stable session and window identities limit the projection. Opening and closing identity probes bound the result, which is a newly materialized snapshot rather than a live collection.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-search-panes",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	window, err := session.ResolveActiveWindow(ctx)
	if err != nil {
		fmt.Println("resolve window:", err)
		return
	}
	if _, err := window.SplitPane(ctx, tmux.SplitPaneRequest{}); err != nil {
		fmt.Println("split:", err)
		return
	}

	// SearchPanes asks tmux; a nil filter matches every pane in the window.
	panes, err := window.SearchPanes(ctx, nil)
	if err != nil {
		fmt.Println("search panes:", err)
		return
	}
	fmt.Println(len(panes))
}
Output:
2

func (Window) Select

func (w Window) Select(ctx context.Context) (Window, error)

Select makes the receiver's exact winlink current in its session. It does not promise focus for clients attached to other sessions. Select returns a canonical freshly materialized Window, which may use another linked session for the same WindowID. If the command succeeds but refresh fails, it returns the receiver with that error. A transport or context error can be delivery-ambiguous; no rollback is attempted.

func (Window) SelectLayout

func (w Window) SelectLayout(ctx context.Context, request SelectLayoutRequest) error

SelectLayout applies one layout operation to the receiver's exact winlink. It changes pane geometry without selecting the window or promising client focus. The materialized receiver is not refreshed, so callers that need current pane geometry must obtain a new snapshot or refresh related models. A transport or context error can be delivery-ambiguous; the void result cannot carry partial state and no rollback is attempted.

func (Window) SelectPane

func (w Window) SelectPane(
	ctx context.Context,
	request WindowSelectPaneRequest,
) (Pane, error)

SelectPane makes an exact or relative pane active in the receiver's exact winlink without selecting the window in its session. Target must belong to that same SessionID and WindowID; a PaneID alone does not identify a linked view. The returned Pane is the freshly materialized active pane in the receiver context, not a canonical ID-only view.

A transport or context error can be delivery-ambiguous and no rollback is attempted. Command or refresh failure returns a zero Pane because active-pane selection cannot return reliable partial identity. Invalid requests match ErrInvalidRequest.

func (Window) Server

func (w Window) Server() Server

Server returns the configured handle that produced the window.

func (Window) Session

func (w Window) Session() (Session, bool)

Session returns this view's parent record when it remains in the same snapshot. It never queries tmux.

func (Window) SessionID

func (w Window) SessionID() SessionID

SessionID returns the linked session containing this view.

func (Window) SetAggressiveResize

func (w Window) SetAggressiveResize(ctx context.Context, value bool) error

SetAggressiveResize stores the "aggressive-resize" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AggressiveResize from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetAllowPassthrough

func (w Window) SetAllowPassthrough(ctx context.Context, value AllowPassthrough) error

SetAllowPassthrough stores the "allow-passthrough" window option, available since tmux 3.3. It accepts AllowPassthrough and does not expose raw set-option flags. Read it back with WindowOptionValues.AllowPassthrough from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetAllowRename

func (w Window) SetAllowRename(ctx context.Context, value bool) error

SetAllowRename stores the "allow-rename" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AllowRename from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetAllowSetTitle

func (w Window) SetAllowSetTitle(ctx context.Context, value bool) error

SetAllowSetTitle stores the "allow-set-title" window option, available since tmux 3.5. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AllowSetTitle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetAlternateScreen

func (w Window) SetAlternateScreen(ctx context.Context, value bool) error

SetAlternateScreen stores the "alternate-screen" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AlternateScreen from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetAutomaticRename

func (w Window) SetAutomaticRename(ctx context.Context, value bool) error

SetAutomaticRename stores the "automatic-rename" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.AutomaticRename from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetAutomaticRenameFormat

func (w Window) SetAutomaticRenameFormat(ctx context.Context, value string) error

SetAutomaticRenameFormat stores the "automatic-rename-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.AutomaticRenameFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetClockModeColour

func (w Window) SetClockModeColour(ctx context.Context, value string) error

SetClockModeColour stores the "clock-mode-colour" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.ClockModeColour from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetClockModeStyle

func (w Window) SetClockModeStyle(ctx context.Context, value ClockModeStyle) error

SetClockModeStyle stores the "clock-mode-style" window option, available since tmux 3.2a. It accepts ClockModeStyle and does not expose raw set-option flags. Read it back with WindowOptionValues.ClockModeStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeCurrentLineNumberStyle

func (w Window) SetCopyModeCurrentLineNumberStyle(ctx context.Context, value string) error

SetCopyModeCurrentLineNumberStyle stores the "copy-mode-current-line-number-style" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeCurrentLineNumberStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeCurrentMatchStyle

func (w Window) SetCopyModeCurrentMatchStyle(ctx context.Context, value string) error

SetCopyModeCurrentMatchStyle stores the "copy-mode-current-match-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeCurrentMatchStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeLineNumberStyle

func (w Window) SetCopyModeLineNumberStyle(ctx context.Context, value string) error

SetCopyModeLineNumberStyle stores the "copy-mode-line-number-style" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeLineNumberStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeLineNumbers

func (w Window) SetCopyModeLineNumbers(ctx context.Context, value CopyModeLineNumbers) error

SetCopyModeLineNumbers stores the "copy-mode-line-numbers" window option, available since tmux 3.7. It accepts CopyModeLineNumbers and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeLineNumbers from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeMarkStyle

func (w Window) SetCopyModeMarkStyle(ctx context.Context, value string) error

SetCopyModeMarkStyle stores the "copy-mode-mark-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeMarkStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeMatchStyle

func (w Window) SetCopyModeMatchStyle(ctx context.Context, value string) error

SetCopyModeMatchStyle stores the "copy-mode-match-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeMatchStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModePositionFormat

func (w Window) SetCopyModePositionFormat(ctx context.Context, value string) error

SetCopyModePositionFormat stores the "copy-mode-position-format" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModePositionFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModePositionStyle

func (w Window) SetCopyModePositionStyle(ctx context.Context, value string) error

SetCopyModePositionStyle stores the "copy-mode-position-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModePositionStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCopyModeSelectionStyle

func (w Window) SetCopyModeSelectionStyle(ctx context.Context, value string) error

SetCopyModeSelectionStyle stores the "copy-mode-selection-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CopyModeSelectionStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCursorColour

func (w Window) SetCursorColour(ctx context.Context, value string) error

SetCursorColour stores the "cursor-colour" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.CursorColour from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetCursorStyle

func (w Window) SetCursorStyle(ctx context.Context, value CursorStyle) error

SetCursorStyle stores the "cursor-style" window option, available since tmux 3.3. It accepts CursorStyle and does not expose raw set-option flags. Read it back with WindowOptionValues.CursorStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetFillCharacter

func (w Window) SetFillCharacter(ctx context.Context, value string) error

SetFillCharacter stores the "fill-character" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.FillCharacter from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetHook

func (w Window) SetHook(ctx context.Context, name string, command string) error

SetHook stores a window hook at this exact window target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (Window) SetHooks

func (w Window) SetHooks(
	ctx context.Context,
	name string,
	values SparseArray[string],
	options SetHooksOptions,
) (SetHooksResult, error)

SetHooks applies indexed window hook commands in ascending order at this handle's exact window target. With ClearExisting it confirms clearing first, stops at the first failure without rollback, and reports confirmed progress. Cancellation may follow accepted commands and cannot disprove their delivery.

func (Window) SetMainPaneHeight

func (w Window) SetMainPaneHeight(ctx context.Context, value string) error

SetMainPaneHeight stores the "main-pane-height" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MainPaneHeight from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMainPaneWidth

func (w Window) SetMainPaneWidth(ctx context.Context, value string) error

SetMainPaneWidth stores the "main-pane-width" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MainPaneWidth from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMenuBorderLines

func (w Window) SetMenuBorderLines(ctx context.Context, value MenuBorderLines) error

SetMenuBorderLines stores the "menu-border-lines" window option, available since tmux 3.4. It accepts MenuBorderLines and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuBorderLines from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMenuBorderStyle

func (w Window) SetMenuBorderStyle(ctx context.Context, value string) error

SetMenuBorderStyle stores the "menu-border-style" window option, available since tmux 3.4. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuBorderStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMenuSelectedStyle

func (w Window) SetMenuSelectedStyle(ctx context.Context, value string) error

SetMenuSelectedStyle stores the "menu-selected-style" window option, available since tmux 3.4. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuSelectedStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMenuStyle

func (w Window) SetMenuStyle(ctx context.Context, value string) error

SetMenuStyle stores the "menu-style" window option, available since tmux 3.4. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.MenuStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetModeKeys

func (w Window) SetModeKeys(ctx context.Context, value ModeKeys) error

SetModeKeys stores the "mode-keys" window option, available since tmux 3.2a. It accepts ModeKeys and does not expose raw set-option flags. Read it back with WindowOptionValues.ModeKeys from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetModeStyle

func (w Window) SetModeStyle(ctx context.Context, value string) error

SetModeStyle stores the "mode-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.ModeStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMonitorActivity

func (w Window) SetMonitorActivity(ctx context.Context, value bool) error

SetMonitorActivity stores the "monitor-activity" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.MonitorActivity from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMonitorBell

func (w Window) SetMonitorBell(ctx context.Context, value bool) error

SetMonitorBell stores the "monitor-bell" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.MonitorBell from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetMonitorSilence

func (w Window) SetMonitorSilence(ctx context.Context, value int64) error

SetMonitorSilence stores the "monitor-silence" window option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with WindowOptionValues.MonitorSilence from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetOption

func (w Window) SetOption(
	ctx context.Context,
	name string,
	value string,
	options SetOptionOptions,
) error

SetOption stores a window option at this exact window target without refreshing existing models. Completed failures are secret-safe option errors; cancellation does not prove tmux did not accept the mutation.

func (Window) SetOtherPaneHeight

func (w Window) SetOtherPaneHeight(ctx context.Context, value string) error

SetOtherPaneHeight stores the "other-pane-height" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.OtherPaneHeight from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetOtherPaneWidth

func (w Window) SetOtherPaneWidth(ctx context.Context, value string) error

SetOtherPaneWidth stores the "other-pane-width" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.OtherPaneWidth from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneActiveBorderStyle

func (w Window) SetPaneActiveBorderStyle(ctx context.Context, value string) error

SetPaneActiveBorderStyle stores the "pane-active-border-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneActiveBorderStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneBaseIndex

func (w Window) SetPaneBaseIndex(ctx context.Context, value int64) error

SetPaneBaseIndex stores the "pane-base-index" window option, available since tmux 3.2a. It accepts int64 and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBaseIndex from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneBorderFormat

func (w Window) SetPaneBorderFormat(ctx context.Context, value string) error

SetPaneBorderFormat stores the "pane-border-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneBorderIndicators

func (w Window) SetPaneBorderIndicators(ctx context.Context, value PaneBorderIndicators) error

SetPaneBorderIndicators stores the "pane-border-indicators" window option, available since tmux 3.3. It accepts PaneBorderIndicators and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderIndicators from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneBorderLines

func (w Window) SetPaneBorderLines(ctx context.Context, value PaneBorderLines) error

SetPaneBorderLines stores the "pane-border-lines" window option, available since tmux 3.2a. It accepts PaneBorderLines and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderLines from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneBorderStatus

func (w Window) SetPaneBorderStatus(ctx context.Context, value PaneBorderStatus) error

SetPaneBorderStatus stores the "pane-border-status" window option, available since tmux 3.2a. It accepts PaneBorderStatus and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderStatus from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneBorderStyle

func (w Window) SetPaneBorderStyle(ctx context.Context, value string) error

SetPaneBorderStyle stores the "pane-border-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneBorderStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneColours

func (w Window) SetPaneColours(ctx context.Context, value SparseArray[string]) (SetArrayResult, error)

SetPaneColours performs a complete replacement of the "pane-colours" window option, available since tmux 3.3. It accepts SparseArray[string], preserves sparse holes and explicit empty values, and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneColours from Window.Options. Use Window.SetOption for caller-named options or raw values. Replacement is not atomic: the result reports only confirmed writes and failures stop without rollback. Callers must serialize replacement of the same target and option when final ordering matters. Use Window.UnsetOption to restore inheritance or the global default.

func (Window) SetPaneScrollbars

func (w Window) SetPaneScrollbars(ctx context.Context, value PaneScrollbars) error

SetPaneScrollbars stores the "pane-scrollbars" window option, available since tmux 3.6. It accepts PaneScrollbars and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneScrollbars from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneScrollbarsPosition

func (w Window) SetPaneScrollbarsPosition(ctx context.Context, value PaneScrollbarsPosition) error

SetPaneScrollbarsPosition stores the "pane-scrollbars-position" window option, available since tmux 3.6. It accepts PaneScrollbarsPosition and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneScrollbarsPosition from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneScrollbarsStyle

func (w Window) SetPaneScrollbarsStyle(ctx context.Context, value string) error

SetPaneScrollbarsStyle stores the "pane-scrollbars-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneScrollbarsStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneStatusCurrentStyle

func (w Window) SetPaneStatusCurrentStyle(ctx context.Context, value string) error

SetPaneStatusCurrentStyle stores the "pane-status-current-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneStatusCurrentStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPaneStatusStyle

func (w Window) SetPaneStatusStyle(ctx context.Context, value string) error

SetPaneStatusStyle stores the "pane-status-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PaneStatusStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPopupBorderLines

func (w Window) SetPopupBorderLines(ctx context.Context, value PopupBorderLines) error

SetPopupBorderLines stores the "popup-border-lines" window option, available since tmux 3.3. It accepts PopupBorderLines and does not expose raw set-option flags. Read it back with WindowOptionValues.PopupBorderLines from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPopupBorderStyle

func (w Window) SetPopupBorderStyle(ctx context.Context, value string) error

SetPopupBorderStyle stores the "popup-border-style" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PopupBorderStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetPopupStyle

func (w Window) SetPopupStyle(ctx context.Context, value string) error

SetPopupStyle stores the "popup-style" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.PopupStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetRemainOnExit

func (w Window) SetRemainOnExit(ctx context.Context, value RemainOnExit) error

SetRemainOnExit stores the "remain-on-exit" window option, available since tmux 3.2a. It accepts RemainOnExit and does not expose raw set-option flags. Read it back with WindowOptionValues.RemainOnExit from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetRemainOnExitFormat

func (w Window) SetRemainOnExitFormat(ctx context.Context, value string) error

SetRemainOnExitFormat stores the "remain-on-exit-format" window option, available since tmux 3.3. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.RemainOnExitFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetScrollOnClear

func (w Window) SetScrollOnClear(ctx context.Context, value bool) error

SetScrollOnClear stores the "scroll-on-clear" window option, available since tmux 3.3. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.ScrollOnClear from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetSessionStatusCurrentStyle

func (w Window) SetSessionStatusCurrentStyle(ctx context.Context, value string) error

SetSessionStatusCurrentStyle stores the "session-status-current-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.SessionStatusCurrentStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetSessionStatusStyle

func (w Window) SetSessionStatusStyle(ctx context.Context, value string) error

SetSessionStatusStyle stores the "session-status-style" window option, available since tmux 3.6. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.SessionStatusStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetSynchronizePanes

func (w Window) SetSynchronizePanes(ctx context.Context, value bool) error

SetSynchronizePanes stores the "synchronize-panes" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.SynchronizePanes from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetTiledLayoutMaxColumns

func (w Window) SetTiledLayoutMaxColumns(ctx context.Context, value int64) error

SetTiledLayoutMaxColumns stores the "tiled-layout-max-columns" window option, available since tmux 3.6. It accepts int64 and does not expose raw set-option flags. Read it back with WindowOptionValues.TiledLayoutMaxColumns from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetTreeModePreviewFormat

func (w Window) SetTreeModePreviewFormat(ctx context.Context, value string) error

SetTreeModePreviewFormat stores the "tree-mode-preview-format" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.TreeModePreviewFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetTreeModePreviewStyle

func (w Window) SetTreeModePreviewStyle(ctx context.Context, value string) error

SetTreeModePreviewStyle stores the "tree-mode-preview-style" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.TreeModePreviewStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowActiveStyle

func (w Window) SetWindowActiveStyle(ctx context.Context, value string) error

SetWindowActiveStyle stores the "window-active-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowActiveStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowPaneCurrentStatusFormat

func (w Window) SetWindowPaneCurrentStatusFormat(ctx context.Context, value string) error

SetWindowPaneCurrentStatusFormat stores the "window-pane-current-status-format" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowPaneCurrentStatusFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowPaneStatusFormat

func (w Window) SetWindowPaneStatusFormat(ctx context.Context, value string) error

SetWindowPaneStatusFormat stores the "window-pane-status-format" window option, available since tmux 3.7. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowPaneStatusFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowSize

func (w Window) SetWindowSize(ctx context.Context, value WindowSize) error

SetWindowSize stores the "window-size" window option, available since tmux 3.2a. It accepts WindowSize and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowSize from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusActivityStyle

func (w Window) SetWindowStatusActivityStyle(ctx context.Context, value string) error

SetWindowStatusActivityStyle stores the "window-status-activity-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusActivityStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusBellStyle

func (w Window) SetWindowStatusBellStyle(ctx context.Context, value string) error

SetWindowStatusBellStyle stores the "window-status-bell-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusBellStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusCurrentFormat

func (w Window) SetWindowStatusCurrentFormat(ctx context.Context, value string) error

SetWindowStatusCurrentFormat stores the "window-status-current-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusCurrentFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusCurrentStyle

func (w Window) SetWindowStatusCurrentStyle(ctx context.Context, value string) error

SetWindowStatusCurrentStyle stores the "window-status-current-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusCurrentStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusFormat

func (w Window) SetWindowStatusFormat(ctx context.Context, value string) error

SetWindowStatusFormat stores the "window-status-format" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusFormat from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusLastStyle

func (w Window) SetWindowStatusLastStyle(ctx context.Context, value string) error

SetWindowStatusLastStyle stores the "window-status-last-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusLastStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusSeparator

func (w Window) SetWindowStatusSeparator(ctx context.Context, value string) error

SetWindowStatusSeparator stores the "window-status-separator" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusSeparator from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStatusStyle

func (w Window) SetWindowStatusStyle(ctx context.Context, value string) error

SetWindowStatusStyle stores the "window-status-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStatusStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWindowStyle

func (w Window) SetWindowStyle(ctx context.Context, value string) error

SetWindowStyle stores the "window-style" window option, available since tmux 3.2a. It accepts string and does not expose raw set-option flags. Read it back with WindowOptionValues.WindowStyle from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetWrapSearch

func (w Window) SetWrapSearch(ctx context.Context, value bool) error

SetWrapSearch stores the "wrap-search" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.WrapSearch from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SetXTermKeys

func (w Window) SetXTermKeys(ctx context.Context, value bool) error

SetXTermKeys stores the "xterm-keys" window option, available since tmux 3.2a. It accepts bool and does not expose raw set-option flags. Read it back with WindowOptionValues.XTermKeys from Window.Options, and Window.UnsetOption restores inheritance or the global default. Use Window.SetOption for caller-named options or raw values.

func (Window) SilenceFlag

func (w Window) SilenceFlag() (bool, bool)

SilenceFlag returns a typed bool value and an ok result parsed from tmux #{window_silence_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) SplitPane

func (w Window) SplitPane(ctx context.Context, request SplitPaneRequest) (Pane, error)

SplitPane creates a tiled pane in the receiver's exact winlink. Attach makes the new pane active in that session and winlink; it is not a global client-focus guarantee. The returned Pane is freshly materialized in the receiver SessionID and WindowID rather than by canonical ID-only refresh.

A transport or context error can be delivery-ambiguous and no rollback is attempted. If tmux printed a valid PaneID before that error, or exact refresh fails after creation, SplitPane returns a partial Pane containing the receiver SessionID and WindowID and the new PaneID. Other failures return a zero Pane. See SplitPaneRequest, WarningHandler, ErrInvalidCommandOutput, and CommandError.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/libtmux/libtmux-go/tmux"
)

// killExampleServer stops an example's server on a context of its own. An
// example's ctx is expired exactly when its run failed on the deadline, which
// is when cleanup matters most, and the socket it names is fixed: a server left
// running fails every later run with a session that already exists.
func killExampleServer(server tmux.Server) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	_ = server.Kill(ctx)
}

func main() {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()
	server := tmux.NewServer(tmux.ServerOptions{
		SocketName: "libtmux-go-example-split-pane",
	})
	defer killExampleServer(server)

	session, err := server.NewSession(ctx, tmux.NewSessionRequest{Name: "build"})
	if err != nil {
		fmt.Println("create session:", err)
		return
	}
	window, err := session.ResolveActiveWindow(ctx)
	if err != nil {
		fmt.Println("resolve window:", err)
		return
	}
	if _, err := window.SplitPane(ctx, tmux.SplitPaneRequest{
		Direction: tmux.PaneDirectionRight,
	}); err != nil {
		fmt.Println("split pane:", err)
		return
	}

	// Window.Panes reads the record's own materialized state and never queries
	// tmux, so a record from a point lookup carries none. Ask tmux for the
	// window's current panes instead; a nil filter matches every pane.
	panes, err := window.SearchPanes(ctx, nil)
	if err != nil {
		fmt.Println("list panes:", err)
		return
	}
	fmt.Println(len(panes))
}
Output:
2

func (Window) StackIndex

func (w Window) StackIndex() (int, bool)

StackIndex returns a typed int value and an ok result parsed from tmux #{window_stack_index} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) StartFlag

func (w Window) StartFlag() (bool, bool)

StartFlag returns a typed bool value and an ok result parsed from tmux #{window_start_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) String

func (w Window) String() string

String returns the winlink identity and its materialized parent, when present.

func (Window) Swap

Swap exchanges the receiver and Target exact winlinks. Their stable WindowIDs move to the opposite session-and-index views; a WindowID alone does not identify either endpoint. Unless Detach is set, tmux may change the affected sessions' current-window selection; this is not a global client-focus guarantee.

Swap returns both freshly materialized exact endpoint views. If exact refresh fails after the command, it returns a predicted WindowSwapResult carrying both stable IDs and post-swap session/index contexts with the error. Other failures return a zero result. A transport or context error can be delivery-ambiguous and no rollback is attempted. See SwapWindowRequest and ErrInvalidRequest.

func (w Window) Unlink(ctx context.Context, request UnlinkWindowRequest) error

Unlink removes the receiver's exact session winlink without refreshing the materialized receiver. Without KillIfLast, tmux rejects removal of a stable window's only link; with it, that window is destroyed. A transport or context error can be delivery-ambiguous; the void result cannot carry partial identity and no rollback is attempted.

func (Window) UnsetHook

func (w Window) UnsetHook(ctx context.Context, name string) error

UnsetHook removes every matching window hook index at this exact window target without refreshing models. Completed failures are secret-safe option errors; cancellation does not prove the unset was accepted.

func (Window) UnsetOption

func (w Window) UnsetOption(
	ctx context.Context,
	name string,
	options UnsetOptionOptions,
) error

UnsetOption unsets a window option at this exact window target, or its pane copies with UnsetPanes, without refreshing models. Cancellation does not prove the unset was not accepted.

func (Window) VisibleLayout

func (w Window) VisibleLayout() (string, bool)

VisibleLayout returns a typed string value and an ok result parsed from tmux #{window_visible_layout} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) Width

func (w Window) Width() (int, bool)

Width returns a typed int value and an ok result parsed from tmux #{window_width} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

func (Window) WithServer

func (w Window) WithServer(server Server) Window

WithServer returns a copy of the window whose operations run through server. It is the write half of Window.Server and queries tmux for nothing: a record holds its handle as a plain field, so moving one onto a handle that selected an Engine with Server.WithEngine costs a struct copy rather than a second lookup.

It exists because a record keeps the handle that produced it. One obtained before an engine was selected keeps starting a tmux process for every command and reports no error while doing so, which is the failure this turns into a one-line fix.

Nothing checks that server addresses the same tmux server, because nothing here talks to tmux. A record moved onto a handle with another socket resolves against whatever answers there and reports a missing target at its next command rather than at this call.

Window.Session and Window.Panes carry the handle of the record they are read from, so one move covers the relations reached through it.

func (Window) ZoomedFlag

func (w Window) ZoomedFlag() (bool, bool)

ZoomedFlag returns a typed bool value and an ok result parsed from tmux #{window_zoomed_flag} in this Window's materialized window-scoped record (tmux 3.2a or later), not a live tmux read. See Server.Snapshot for a fresh hierarchy and Window.Formats for projected fields. ok == false means the field was absent, empty, or malformed; use FormatValues.Raw to inspect the exact materialized expansion.

type WindowFilter

type WindowFilter struct {
	// SessionID exactly matches the stable tmux session identifier from Window.SessionID, including its $ sigil. A nil pointer leaves SessionID unset; a non-nil pointer applies it, including when it points to the zero value.
	SessionID *SessionID `json:"sessionId,omitempty"`
	// SessionIDIn lists accepted values for the stable tmux session identifier from Window.SessionID, including its $ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves SessionIDIn unset; a non-nil empty slice is invalid.
	SessionIDIn []SessionID `json:"sessionIdIn,omitempty"`
	// ID exactly matches the stable tmux window identifier from Window.ID, including its @ sigil. A nil pointer leaves ID unset; a non-nil pointer applies it, including when it points to the zero value.
	ID *WindowID `json:"id,omitempty"`
	// IDIn lists accepted values for the stable tmux window identifier from Window.ID, including its @ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves IDIn unset; a non-nil empty slice is invalid.
	IDIn []WindowID `json:"idIn,omitempty"`
	// Index exactly matches the nonnegative winlink index from Window.Index. A nil pointer leaves Index unset; a non-nil pointer applies it, including when it points to the zero value.
	Index *int `json:"index,omitempty"`
	// IndexIn lists accepted values for the nonnegative winlink index from Window.Index. A candidate matches when its materialized value equals one listed value. A nil slice leaves IndexIn unset; a non-nil empty slice is invalid.
	IndexIn []int `json:"indexIn,omitempty"`
	// IndexGT requires the nonnegative winlink index from Window.Index to be strictly greater than the pointed-to value. A nil pointer leaves IndexGT unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexGT *int `json:"indexGt,omitempty"`
	// IndexGTE requires the nonnegative winlink index from Window.Index to be greater than or equal to the pointed-to value. A nil pointer leaves IndexGTE unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexGTE *int `json:"indexGte,omitempty"`
	// IndexLT requires the nonnegative winlink index from Window.Index to be strictly less than the pointed-to value. A nil pointer leaves IndexLT unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexLT *int `json:"indexLt,omitempty"`
	// IndexLTE requires the nonnegative winlink index from Window.Index to be less than or equal to the pointed-to value. A nil pointer leaves IndexLTE unset; a non-nil pointer applies it, including when it points to the zero value.
	IndexLTE *int `json:"indexLte,omitempty"`
	// Name exactly matches the materialized window name from Window.Name. A nil pointer leaves Name unset; a non-nil pointer applies it, including when it points to the zero value.
	Name *string `json:"name,omitempty"`
	// NameIn lists accepted values for the materialized window name from Window.Name. A candidate matches when its materialized value equals one listed value. A nil slice leaves NameIn unset; a non-nil empty slice is invalid.
	NameIn []string `json:"nameIn,omitempty"`
	// NameContains requires the materialized window name from Window.Name to contain the pointed-to substring. A nil pointer leaves NameContains unset; a non-nil pointer applies it, and an empty string matches every available string.
	NameContains *string `json:"nameContains,omitempty"`
	// NameRegex requires the materialized window name from Window.Name to match Go regular expression syntax. An empty string leaves NameRegex unset.
	NameRegex string `json:"nameRegex,omitempty"`
	// Active exactly matches the materialized active state from Window.Active. A nil pointer leaves Active unset; a non-nil pointer applies it, including when it points to the zero value.
	Active *bool `json:"active,omitempty"`
	// AnyOf additionally requires at least one branch to match after ordinary criteria match. A nil slice leaves AnyOf unset; a non-nil empty slice is invalid.
	AnyOf []WindowFilter `json:"anyOf,omitempty"`
	// Not excludes a candidate when its nested filter matches. A nil pointer leaves Not unset.
	Not *WindowFilter `json:"not,omitempty"`
	// Session traverses the materialized parent returned by Window.Session. A nil pointer leaves the relation criterion unset.
	Session *SessionFilter `json:"session,omitempty"`
	// Panes traverses the materialized pane views returned by Window.Panes. A nil pointer leaves the relation criterion unset.
	Panes *PaneRel `json:"panes,omitempty"`
}

WindowFilter evaluates already-materialized Window values and never runs tmux. Its zero value matches every non-nil candidate. Ordinary field and relation criteria are ANDed. AnyOf additionally requires at least one branch to match; Not excludes a match. Field and relation criteria correspond to Window.SessionID, Window.ID, Window.Index, Window.Name, Window.Active, Window.Session, and Window.Panes. WindowFilter.Predicate, WindowFilter.MarshalJSON, and WindowFilter.UnmarshalJSON validate automatically. Use WindowFilter.Validate to check a filter constructed directly.

func ParseWindowLookup

func ParseWindowLookup(lookup string, values ...string) (WindowFilter, error)

ParseWindowLookup converts a lookup path into a concrete window filter. Paths traverse generated JSON relation names and separate segments with double underscores. The default operator is exact. Accepted suffixes are eq, exact, iexact, contains, icontains, startswith, istartswith, endswith, iendswith, in, nin, regex, and iregex; availability is field-specific. The eq suffix aliases exact, nin negates in, scalar operators require one value, and in and nin require one or more. Invalid paths, operators, values, or results return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func WindowActiveIs

func WindowActiveIs(value bool) WindowFilter

WindowActiveIs returns a WindowFilter that exactly matches the materialized active state from Window.Active. It sets no other criteria and does not validate value.

func WindowIDIs

func WindowIDIs(value WindowID) WindowFilter

WindowIDIs returns a WindowFilter that exactly matches the stable tmux window identifier from Window.ID, including its @ sigil. It sets no other criteria and does not validate value.

func WindowIndexIs

func WindowIndexIs(value int) WindowFilter

WindowIndexIs returns a WindowFilter that exactly matches the nonnegative winlink index from Window.Index. It sets no other criteria and does not validate value.

func WindowNameIs

func WindowNameIs(value string) WindowFilter

WindowNameIs returns a WindowFilter that exactly matches the materialized window name from Window.Name. It sets no other criteria and does not validate value.

func WindowSessionIDIs

func WindowSessionIDIs(value SessionID) WindowFilter

WindowSessionIDIs returns a WindowFilter that exactly matches the stable tmux session identifier from Window.SessionID, including its $ sigil. It sets no other criteria and does not validate value.

func (WindowFilter) MarshalJSON

func (filter WindowFilter) MarshalJSON() ([]byte, error)

MarshalJSON validates the window filter and encodes its JSON wire object. FilterSchemaVersion remains external metadata and is not embedded in the object. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (WindowFilter) Predicate

func (filter WindowFilter) Predicate() (func(*Window) bool, error)

Predicate validates the window filter and returns a local predicate accepting Window values already materialized by a Snapshot; it never runs tmux. Relation criteria traverse only relationships already materialized on that candidate. The predicate returns false for a nil candidate. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (*WindowFilter) UnmarshalJSON

func (filter *WindowFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON clears the receiver, then decodes a strict window filter JSON object. FilterSchemaVersion remains external metadata and is not embedded in the object. It rejects unknown or duplicate fields and trailing JSON, then validates decoded criteria. On error, the receiver can retain a partial or complete decoded value. All decode and framing failures and semantic validation failures return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

func (WindowFilter) Validate

func (filter WindowFilter) Validate() error

Validate checks structure, regular expressions, and contradictory criteria before filter use. Invalid filters return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

type WindowHookValues

type WindowHookValues struct {
	// contains filtered or unexported fields
}

WindowHookValues is an immutable point-in-time view of known window hook values. Its zero value has no present values. Obtain it with Window.Hooks or GlobalWindowScope.Hooks; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (WindowHookValues) PaneDied

PaneDied returns the "pane-died" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) PaneExited

PaneExited returns the "pane-exited" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) PaneFocusIn

func (v WindowHookValues) PaneFocusIn() OptionValue[SparseArray[string]]

PaneFocusIn returns the "pane-focus-in" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) PaneFocusOut

func (v WindowHookValues) PaneFocusOut() OptionValue[SparseArray[string]]

PaneFocusOut returns the "pane-focus-out" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) PaneModeChanged

func (v WindowHookValues) PaneModeChanged() OptionValue[SparseArray[string]]

PaneModeChanged returns the "pane-mode-changed" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) PaneSetClipboard

func (v WindowHookValues) PaneSetClipboard() OptionValue[SparseArray[string]]

PaneSetClipboard returns the "pane-set-clipboard" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) PaneTitleChanged

func (v WindowHookValues) PaneTitleChanged() OptionValue[SparseArray[string]]

PaneTitleChanged returns the "pane-title-changed" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) WindowLayoutChanged

func (v WindowHookValues) WindowLayoutChanged() OptionValue[SparseArray[string]]

WindowLayoutChanged returns the "window-layout-changed" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) WindowLinked

func (v WindowHookValues) WindowLinked() OptionValue[SparseArray[string]]

WindowLinked returns the "window-linked" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) WindowPaneChanged

func (v WindowHookValues) WindowPaneChanged() OptionValue[SparseArray[string]]

WindowPaneChanged returns the "window-pane-changed" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) WindowRenamed

func (v WindowHookValues) WindowRenamed() OptionValue[SparseArray[string]]

WindowRenamed returns the "window-renamed" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) WindowResized

func (v WindowHookValues) WindowResized() OptionValue[SparseArray[string]]

WindowResized returns the "window-resized" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.3. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowHookValues) WindowUnlinked

func (v WindowHookValues) WindowUnlinked() OptionValue[SparseArray[string]]

WindowUnlinked returns the "window-unlinked" window hook value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COMMAND since tmux 3.2a. Use Window.RawHook or GlobalWindowScope.RawHook for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

type WindowID

type WindowID string

WindowID is tmux's stable window identifier, including its @ sigil. It does not distinguish linked-session views; the zero value is not a usable target.

func (WindowID) String

func (id WindowID) String() string

String returns the tmux identifier verbatim.

type WindowOptionValues

type WindowOptionValues struct {
	// contains filtered or unexported fields
}

WindowOptionValues is an immutable point-in-time view of known window option values. Its zero value has no present values. Obtain it with Window.Options or GlobalWindowScope.Options; it may become stale after tmux changes. Use OptionValue.Get to read a present value and OptionValue.Origin to distinguish values set at this scope from inherited values.

func (WindowOptionValues) AggressiveResize

func (v WindowOptionValues) AggressiveResize() OptionValue[bool]

AggressiveResize returns the "aggressive-resize" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetAggressiveResize or GlobalWindowScope.SetAggressiveResize. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) AllowPassthrough

func (v WindowOptionValues) AllowPassthrough() OptionValue[AllowPassthrough]

AllowPassthrough returns the "allow-passthrough" window option value as OptionValue with Go value shape OptionValue[AllowPassthrough]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.3; CHOICE since tmux 3.4 (choices: "off", "on", "all"). Set it with Window.SetAllowPassthrough or GlobalWindowScope.SetAllowPassthrough. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) AllowRename

func (v WindowOptionValues) AllowRename() OptionValue[bool]

AllowRename returns the "allow-rename" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetAllowRename or GlobalWindowScope.SetAllowRename. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) AllowSetTitle

func (v WindowOptionValues) AllowSetTitle() OptionValue[bool]

AllowSetTitle returns the "allow-set-title" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.5. Set it with Window.SetAllowSetTitle or GlobalWindowScope.SetAllowSetTitle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) AlternateScreen

func (v WindowOptionValues) AlternateScreen() OptionValue[bool]

AlternateScreen returns the "alternate-screen" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetAlternateScreen or GlobalWindowScope.SetAlternateScreen. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) AutomaticRename

func (v WindowOptionValues) AutomaticRename() OptionValue[bool]

AutomaticRename returns the "automatic-rename" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetAutomaticRename or GlobalWindowScope.SetAutomaticRename. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) AutomaticRenameFormat

func (v WindowOptionValues) AutomaticRenameFormat() OptionValue[string]

AutomaticRenameFormat returns the "automatic-rename-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetAutomaticRenameFormat or GlobalWindowScope.SetAutomaticRenameFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) ClockModeColour

func (v WindowOptionValues) ClockModeColour() OptionValue[string]

ClockModeColour returns the "clock-mode-colour" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.2a. Set it with Window.SetClockModeColour or GlobalWindowScope.SetClockModeColour. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) ClockModeStyle

func (v WindowOptionValues) ClockModeStyle() OptionValue[ClockModeStyle]

ClockModeStyle returns the "clock-mode-style" window option value as OptionValue with Go value shape OptionValue[ClockModeStyle]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "12", "24"); CHOICE since tmux 3.6 (choices: "12", "24", "12-with-seconds", "24-with-seconds"). Set it with Window.SetClockModeStyle or GlobalWindowScope.SetClockModeStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) CopyModeCurrentLineNumberStyle

func (v WindowOptionValues) CopyModeCurrentLineNumberStyle() OptionValue[string]

CopyModeCurrentLineNumberStyle returns the "copy-mode-current-line-number-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Window.SetCopyModeCurrentLineNumberStyle or GlobalWindowScope.SetCopyModeCurrentLineNumberStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CopyModeCurrentMatchStyle

func (v WindowOptionValues) CopyModeCurrentMatchStyle() OptionValue[string]

CopyModeCurrentMatchStyle returns the "copy-mode-current-match-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetCopyModeCurrentMatchStyle or GlobalWindowScope.SetCopyModeCurrentMatchStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CopyModeLineNumberStyle

func (v WindowOptionValues) CopyModeLineNumberStyle() OptionValue[string]

CopyModeLineNumberStyle returns the "copy-mode-line-number-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Window.SetCopyModeLineNumberStyle or GlobalWindowScope.SetCopyModeLineNumberStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CopyModeLineNumbers

func (v WindowOptionValues) CopyModeLineNumbers() OptionValue[CopyModeLineNumbers]

CopyModeLineNumbers returns the "copy-mode-line-numbers" window option value as OptionValue with Go value shape OptionValue[CopyModeLineNumbers]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.7 (choices: "off", "default", "absolute", "relative", "hybrid"). Set it with Window.SetCopyModeLineNumbers or GlobalWindowScope.SetCopyModeLineNumbers. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) CopyModeMarkStyle

func (v WindowOptionValues) CopyModeMarkStyle() OptionValue[string]

CopyModeMarkStyle returns the "copy-mode-mark-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetCopyModeMarkStyle or GlobalWindowScope.SetCopyModeMarkStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CopyModeMatchStyle

func (v WindowOptionValues) CopyModeMatchStyle() OptionValue[string]

CopyModeMatchStyle returns the "copy-mode-match-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetCopyModeMatchStyle or GlobalWindowScope.SetCopyModeMatchStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CopyModePositionFormat

func (v WindowOptionValues) CopyModePositionFormat() OptionValue[string]

CopyModePositionFormat returns the "copy-mode-position-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetCopyModePositionFormat or GlobalWindowScope.SetCopyModePositionFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) CopyModePositionStyle

func (v WindowOptionValues) CopyModePositionStyle() OptionValue[string]

CopyModePositionStyle returns the "copy-mode-position-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetCopyModePositionStyle or GlobalWindowScope.SetCopyModePositionStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CopyModeSelectionStyle

func (v WindowOptionValues) CopyModeSelectionStyle() OptionValue[string]

CopyModeSelectionStyle returns the "copy-mode-selection-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetCopyModeSelectionStyle or GlobalWindowScope.SetCopyModeSelectionStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) CursorColour

func (v WindowOptionValues) CursorColour() OptionValue[string]

CursorColour returns the "cursor-colour" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.3. Set it with Window.SetCursorColour or GlobalWindowScope.SetCursorColour. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) CursorStyle

func (v WindowOptionValues) CursorStyle() OptionValue[CursorStyle]

CursorStyle returns the "cursor-style" window option value as OptionValue with Go value shape OptionValue[CursorStyle]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.3 (choices: "default", "blinking-block", "block", "blinking-underline", "underline", "blinking-bar", "bar"). Set it with Window.SetCursorStyle or GlobalWindowScope.SetCursorStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) FillCharacter

func (v WindowOptionValues) FillCharacter() OptionValue[string]

FillCharacter returns the "fill-character" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.3. Set it with Window.SetFillCharacter or GlobalWindowScope.SetFillCharacter. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) MainPaneHeight

func (v WindowOptionValues) MainPaneHeight() OptionValue[string]

MainPaneHeight returns the "main-pane-height" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetMainPaneHeight or GlobalWindowScope.SetMainPaneHeight. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) MainPaneWidth

func (v WindowOptionValues) MainPaneWidth() OptionValue[string]

MainPaneWidth returns the "main-pane-width" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetMainPaneWidth or GlobalWindowScope.SetMainPaneWidth. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) MenuBorderLines

func (v WindowOptionValues) MenuBorderLines() OptionValue[MenuBorderLines]

MenuBorderLines returns the "menu-border-lines" window option value as OptionValue with Go value shape OptionValue[MenuBorderLines]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.4 (choices: "single", "double", "heavy", "simple", "rounded", "padded", "none"). Set it with Window.SetMenuBorderLines or GlobalWindowScope.SetMenuBorderLines. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) MenuBorderStyle

func (v WindowOptionValues) MenuBorderStyle() OptionValue[string]

MenuBorderStyle returns the "menu-border-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.4. Set it with Window.SetMenuBorderStyle or GlobalWindowScope.SetMenuBorderStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) MenuSelectedStyle

func (v WindowOptionValues) MenuSelectedStyle() OptionValue[string]

MenuSelectedStyle returns the "menu-selected-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.4. Set it with Window.SetMenuSelectedStyle or GlobalWindowScope.SetMenuSelectedStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) MenuStyle

func (v WindowOptionValues) MenuStyle() OptionValue[string]

MenuStyle returns the "menu-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.4. Set it with Window.SetMenuStyle or GlobalWindowScope.SetMenuStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) ModeKeys

func (v WindowOptionValues) ModeKeys() OptionValue[ModeKeys]

ModeKeys returns the "mode-keys" window option value as OptionValue with Go value shape OptionValue[ModeKeys]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "emacs", "vi"). Set it with Window.SetModeKeys or GlobalWindowScope.SetModeKeys. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) ModeStyle

func (v WindowOptionValues) ModeStyle() OptionValue[string]

ModeStyle returns the "mode-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetModeStyle or GlobalWindowScope.SetModeStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) MonitorActivity

func (v WindowOptionValues) MonitorActivity() OptionValue[bool]

MonitorActivity returns the "monitor-activity" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetMonitorActivity or GlobalWindowScope.SetMonitorActivity. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) MonitorBell

func (v WindowOptionValues) MonitorBell() OptionValue[bool]

MonitorBell returns the "monitor-bell" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetMonitorBell or GlobalWindowScope.SetMonitorBell. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) MonitorSilence

func (v WindowOptionValues) MonitorSilence() OptionValue[int64]

MonitorSilence returns the "monitor-silence" window option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Window.SetMonitorSilence or GlobalWindowScope.SetMonitorSilence. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) OtherPaneHeight

func (v WindowOptionValues) OtherPaneHeight() OptionValue[string]

OtherPaneHeight returns the "other-pane-height" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetOtherPaneHeight or GlobalWindowScope.SetOtherPaneHeight. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) OtherPaneWidth

func (v WindowOptionValues) OtherPaneWidth() OptionValue[string]

OtherPaneWidth returns the "other-pane-width" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetOtherPaneWidth or GlobalWindowScope.SetOtherPaneWidth. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneActiveBorderStyle

func (v WindowOptionValues) PaneActiveBorderStyle() OptionValue[string]

PaneActiveBorderStyle returns the "pane-active-border-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a; STRING since tmux 3.7. Set it with Window.SetPaneActiveBorderStyle or GlobalWindowScope.SetPaneActiveBorderStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) PaneBaseIndex

func (v WindowOptionValues) PaneBaseIndex() OptionValue[int64]

PaneBaseIndex returns the "pane-base-index" window option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.2a. Set it with Window.SetPaneBaseIndex or GlobalWindowScope.SetPaneBaseIndex. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneBorderFormat

func (v WindowOptionValues) PaneBorderFormat() OptionValue[string]

PaneBorderFormat returns the "pane-border-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a; STRING since tmux 3.3. Set it with Window.SetPaneBorderFormat or GlobalWindowScope.SetPaneBorderFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneBorderIndicators

func (v WindowOptionValues) PaneBorderIndicators() OptionValue[PaneBorderIndicators]

PaneBorderIndicators returns the "pane-border-indicators" window option value as OptionValue with Go value shape OptionValue[PaneBorderIndicators]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.3 (choices: "off", "colour", "arrows", "both"). Set it with Window.SetPaneBorderIndicators or GlobalWindowScope.SetPaneBorderIndicators. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneBorderLines

func (v WindowOptionValues) PaneBorderLines() OptionValue[PaneBorderLines]

PaneBorderLines returns the "pane-border-lines" window option value as OptionValue with Go value shape OptionValue[PaneBorderLines]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "single", "double", "heavy", "simple", "number"); CHOICE since tmux 3.6 (choices: "single", "double", "heavy", "simple", "number", "spaces"). Set it with Window.SetPaneBorderLines or GlobalWindowScope.SetPaneBorderLines. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneBorderStatus

func (v WindowOptionValues) PaneBorderStatus() OptionValue[PaneBorderStatus]

PaneBorderStatus returns the "pane-border-status" window option value as OptionValue with Go value shape OptionValue[PaneBorderStatus]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "top", "bottom"). Set it with Window.SetPaneBorderStatus or GlobalWindowScope.SetPaneBorderStatus. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneBorderStyle

func (v WindowOptionValues) PaneBorderStyle() OptionValue[string]

PaneBorderStyle returns the "pane-border-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a; STRING since tmux 3.7. Set it with Window.SetPaneBorderStyle or GlobalWindowScope.SetPaneBorderStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) PaneColours

PaneColours returns the "pane-colours" window option value as OptionValue with Go value shape OptionValue[SparseArray[string]]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are COLOUR since tmux 3.3. Set it with Window.SetPaneColours or GlobalWindowScope.SetPaneColours. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option. Its present SparseArray value preserves assigned tmux indexes, including gaps.

func (WindowOptionValues) PaneScrollbars

func (v WindowOptionValues) PaneScrollbars() OptionValue[PaneScrollbars]

PaneScrollbars returns the "pane-scrollbars" window option value as OptionValue with Go value shape OptionValue[PaneScrollbars]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.6 (choices: "off", "modal", "on"). Set it with Window.SetPaneScrollbars or GlobalWindowScope.SetPaneScrollbars. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneScrollbarsPosition

func (v WindowOptionValues) PaneScrollbarsPosition() OptionValue[PaneScrollbarsPosition]

PaneScrollbarsPosition returns the "pane-scrollbars-position" window option value as OptionValue with Go value shape OptionValue[PaneScrollbarsPosition]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.6 (choices: "right", "left"). Set it with Window.SetPaneScrollbarsPosition or GlobalWindowScope.SetPaneScrollbarsPosition. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PaneScrollbarsStyle

func (v WindowOptionValues) PaneScrollbarsStyle() OptionValue[string]

PaneScrollbarsStyle returns the "pane-scrollbars-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetPaneScrollbarsStyle or GlobalWindowScope.SetPaneScrollbarsStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) PaneStatusCurrentStyle

func (v WindowOptionValues) PaneStatusCurrentStyle() OptionValue[string]

PaneStatusCurrentStyle returns the "pane-status-current-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetPaneStatusCurrentStyle or GlobalWindowScope.SetPaneStatusCurrentStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) PaneStatusStyle

func (v WindowOptionValues) PaneStatusStyle() OptionValue[string]

PaneStatusStyle returns the "pane-status-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetPaneStatusStyle or GlobalWindowScope.SetPaneStatusStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) PopupBorderLines

func (v WindowOptionValues) PopupBorderLines() OptionValue[PopupBorderLines]

PopupBorderLines returns the "popup-border-lines" window option value as OptionValue with Go value shape OptionValue[PopupBorderLines]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.3 (choices: "single", "double", "heavy", "simple", "rounded", "padded", "none"). Set it with Window.SetPopupBorderLines or GlobalWindowScope.SetPopupBorderLines. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) PopupBorderStyle

func (v WindowOptionValues) PopupBorderStyle() OptionValue[string]

PopupBorderStyle returns the "popup-border-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.3. Set it with Window.SetPopupBorderStyle or GlobalWindowScope.SetPopupBorderStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) PopupStyle

func (v WindowOptionValues) PopupStyle() OptionValue[string]

PopupStyle returns the "popup-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.3. Set it with Window.SetPopupStyle or GlobalWindowScope.SetPopupStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) RemainOnExit

func (v WindowOptionValues) RemainOnExit() OptionValue[RemainOnExit]

RemainOnExit returns the "remain-on-exit" window option value as OptionValue with Go value shape OptionValue[RemainOnExit]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "off", "on", "failed"); CHOICE since tmux 3.7 (choices: "off", "on", "failed", "key"). Set it with Window.SetRemainOnExit or GlobalWindowScope.SetRemainOnExit. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) RemainOnExitFormat

func (v WindowOptionValues) RemainOnExitFormat() OptionValue[string]

RemainOnExitFormat returns the "remain-on-exit-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.3. Set it with Window.SetRemainOnExitFormat or GlobalWindowScope.SetRemainOnExitFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) ScrollOnClear

func (v WindowOptionValues) ScrollOnClear() OptionValue[bool]

ScrollOnClear returns the "scroll-on-clear" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.3. Set it with Window.SetScrollOnClear or GlobalWindowScope.SetScrollOnClear. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) SessionStatusCurrentStyle

func (v WindowOptionValues) SessionStatusCurrentStyle() OptionValue[string]

SessionStatusCurrentStyle returns the "session-status-current-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetSessionStatusCurrentStyle or GlobalWindowScope.SetSessionStatusCurrentStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) SessionStatusStyle

func (v WindowOptionValues) SessionStatusStyle() OptionValue[string]

SessionStatusStyle returns the "session-status-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.6. Set it with Window.SetSessionStatusStyle or GlobalWindowScope.SetSessionStatusStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) SynchronizePanes

func (v WindowOptionValues) SynchronizePanes() OptionValue[bool]

SynchronizePanes returns the "synchronize-panes" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetSynchronizePanes or GlobalWindowScope.SetSynchronizePanes. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) TiledLayoutMaxColumns

func (v WindowOptionValues) TiledLayoutMaxColumns() OptionValue[int64]

TiledLayoutMaxColumns returns the "tiled-layout-max-columns" window option value as OptionValue with Go value shape OptionValue[int64]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are NUMBER since tmux 3.6. Set it with Window.SetTiledLayoutMaxColumns or GlobalWindowScope.SetTiledLayoutMaxColumns. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) TreeModePreviewFormat

func (v WindowOptionValues) TreeModePreviewFormat() OptionValue[string]

TreeModePreviewFormat returns the "tree-mode-preview-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Window.SetTreeModePreviewFormat or GlobalWindowScope.SetTreeModePreviewFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) TreeModePreviewStyle

func (v WindowOptionValues) TreeModePreviewStyle() OptionValue[string]

TreeModePreviewStyle returns the "tree-mode-preview-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Window.SetTreeModePreviewStyle or GlobalWindowScope.SetTreeModePreviewStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowActiveStyle

func (v WindowOptionValues) WindowActiveStyle() OptionValue[string]

WindowActiveStyle returns the "window-active-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowActiveStyle or GlobalWindowScope.SetWindowActiveStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowPaneCurrentStatusFormat

func (v WindowOptionValues) WindowPaneCurrentStatusFormat() OptionValue[string]

WindowPaneCurrentStatusFormat returns the "window-pane-current-status-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Window.SetWindowPaneCurrentStatusFormat or GlobalWindowScope.SetWindowPaneCurrentStatusFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) WindowPaneStatusFormat

func (v WindowOptionValues) WindowPaneStatusFormat() OptionValue[string]

WindowPaneStatusFormat returns the "window-pane-status-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.7. Set it with Window.SetWindowPaneStatusFormat or GlobalWindowScope.SetWindowPaneStatusFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) WindowSize

func (v WindowOptionValues) WindowSize() OptionValue[WindowSize]

WindowSize returns the "window-size" window option value as OptionValue with Go value shape OptionValue[WindowSize]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are CHOICE since tmux 3.2a (choices: "largest", "smallest", "manual", "latest"). Set it with Window.SetWindowSize or GlobalWindowScope.SetWindowSize. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) WindowStatusActivityStyle

func (v WindowOptionValues) WindowStatusActivityStyle() OptionValue[string]

WindowStatusActivityStyle returns the "window-status-activity-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusActivityStyle or GlobalWindowScope.SetWindowStatusActivityStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowStatusBellStyle

func (v WindowOptionValues) WindowStatusBellStyle() OptionValue[string]

WindowStatusBellStyle returns the "window-status-bell-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusBellStyle or GlobalWindowScope.SetWindowStatusBellStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowStatusCurrentFormat

func (v WindowOptionValues) WindowStatusCurrentFormat() OptionValue[string]

WindowStatusCurrentFormat returns the "window-status-current-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusCurrentFormat or GlobalWindowScope.SetWindowStatusCurrentFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) WindowStatusCurrentStyle

func (v WindowOptionValues) WindowStatusCurrentStyle() OptionValue[string]

WindowStatusCurrentStyle returns the "window-status-current-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusCurrentStyle or GlobalWindowScope.SetWindowStatusCurrentStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowStatusFormat

func (v WindowOptionValues) WindowStatusFormat() OptionValue[string]

WindowStatusFormat returns the "window-status-format" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusFormat or GlobalWindowScope.SetWindowStatusFormat. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) WindowStatusLastStyle

func (v WindowOptionValues) WindowStatusLastStyle() OptionValue[string]

WindowStatusLastStyle returns the "window-status-last-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusLastStyle or GlobalWindowScope.SetWindowStatusLastStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowStatusSeparator

func (v WindowOptionValues) WindowStatusSeparator() OptionValue[string]

WindowStatusSeparator returns the "window-status-separator" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusSeparator or GlobalWindowScope.SetWindowStatusSeparator. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) WindowStatusStyle

func (v WindowOptionValues) WindowStatusStyle() OptionValue[string]

WindowStatusStyle returns the "window-status-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStatusStyle or GlobalWindowScope.SetWindowStatusStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WindowStyle

func (v WindowOptionValues) WindowStyle() OptionValue[string]

WindowStyle returns the "window-style" window option value as OptionValue with Go value shape OptionValue[string]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are STRING since tmux 3.2a. Set it with Window.SetWindowStyle or GlobalWindowScope.SetWindowStyle. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is a style option.

func (WindowOptionValues) WrapSearch

func (v WindowOptionValues) WrapSearch() OptionValue[bool]

WrapSearch returns the "wrap-search" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetWrapSearch or GlobalWindowScope.SetWrapSearch. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

func (WindowOptionValues) XTermKeys

func (v WindowOptionValues) XTermKeys() OptionValue[bool]

XTermKeys returns the "xterm-keys" window option value as OptionValue with Go value shape OptionValue[bool]. It does not query tmux. Its scope-specific minimum tmux version and supported variants are FLAG since tmux 3.2a. Set it with Window.SetXTermKeys or GlobalWindowScope.SetXTermKeys. Use Window.RawOption or GlobalWindowScope.RawOption for caller-named or undecoded values. It is not a style option.

type WindowRel

type WindowRel struct {
	// Some requires an existential match: at least one related value must match.
	Some *WindowFilter `json:"some,omitempty"`
	// Every requires a universal match and is vacuously true for an empty relation.
	Every *WindowFilter `json:"every,omitempty"`
	// None excludes the candidate when any related value matches.
	None *WindowFilter `json:"none,omitempty"`
}

WindowRel applies quantifiers to a materialized Window relation. Its zero value is invalid. Some is existential, None is exclusion, and Every is universal and vacuously true for an empty relation. All enabled quantifiers are conjunctive.

func (WindowRel) MarshalJSON

func (relation WindowRel) MarshalJSON() ([]byte, error)

MarshalJSON validates and encodes the window relation quantifiers as JSON. FilterSchemaVersion remains external metadata and is not embedded in the object. The zero relation returns ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect it.

func (*WindowRel) UnmarshalJSON

func (relation *WindowRel) UnmarshalJSON(data []byte) error

UnmarshalJSON clears the receiver, then decodes strict window relation quantifiers. FilterSchemaVersion remains external metadata and is not embedded in the object. It rejects unknown or duplicate fields and trailing JSON, then validates decoded criteria. On error, the receiver can retain a partial or complete decoded value. All decode and framing failures and semantic validation failures return ErrInvalidFilter; use errors.Is(err, ErrInvalidFilter) to detect them.

type WindowResizeDirection

type WindowResizeDirection uint8

WindowResizeDirection selects one directional resize operation on tmux 3.2a or later. Its zero value selects no directional adjustment.

const (
	// WindowResizeDirectionNone selects no directional adjustment.
	WindowResizeDirectionNone WindowResizeDirection = iota
	// WindowResizeDirectionUp adjusts the window upward.
	WindowResizeDirectionUp
	// WindowResizeDirectionDown adjusts the window downward.
	WindowResizeDirectionDown
	// WindowResizeDirectionLeft adjusts the window leftward.
	WindowResizeDirectionLeft
	// WindowResizeDirectionRight adjusts the window rightward.
	WindowResizeDirectionRight
)

Supported window resize directions.

type WindowSelectPaneRequest

type WindowSelectPaneRequest struct {
	// Target selects one exact pane in the receiver winlink; a zero Pane omits
	// this choice.
	Target Pane
	// Direction selects a pane relative to the receiver window's active pane;
	// zero omits this choice.
	Direction PaneSelectDirection
	// KeepZoom preserves the window's zoomed state.
	KeepZoom bool
}

WindowSelectPaneRequest selects either one exact pane or one relative pane. Its zero value is invalid: exactly one of Target and Direction is required. Target must be a complete pane handle in the receiver's exact winlink and must be proven to share a daemon through connection state or the same nonempty SocketPath; matching socket names alone are insufficient. Invalid values are rejected before execution. The request is copied for the call, retained nowhere, and is supported on tmux 3.2a or later.

type WindowSize

type WindowSize string

WindowSize is a typed value for the "window-size" tmux option. Its zero value is invalid.

const (
	// WindowSizeLargest selects "largest".
	WindowSizeLargest WindowSize = "largest"
	// WindowSizeSmallest selects "smallest".
	WindowSizeSmallest WindowSize = "smallest"
	// WindowSizeManual selects "manual".
	WindowSizeManual WindowSize = "manual"
	// WindowSizeLatest selects "latest".
	WindowSizeLatest WindowSize = "latest"
)

func (WindowSize) String

func (v WindowSize) String() string

String returns the exact tmux spelling of v.

func (WindowSize) Valid

func (v WindowSize) Valid() bool

Valid reports whether v belongs to the supported tmux-version union.

type WindowSwapResult

type WindowSwapResult struct {
	// Window is the receiver's original WindowID at its post-swap exact winlink.
	Window Window
	// Target is the target's original WindowID at its post-swap exact winlink.
	Target Window
}

WindowSwapResult contains both original stable window identities in their post-swap exact winlink views. Its zero value contains no usable endpoints. Returned models are newly materialized snapshots; the result owns its value fields and is supported on tmux 3.2a or later.

Directories

Path Synopsis
internal
generate/docs command
Command docs keeps the Go in the repository's markdown identical to Go that compiles.
Command docs keeps the Go in the repository's markdown identical to Go that compiles.
generate/filters command
Command filters generates the typed tmux snapshot filters.
Command filters generates the typed tmux snapshot filters.
generate/formats command
Command formats generates tmux format metadata and typed accessors.
Command formats generates tmux format metadata and typed accessors.
generate/options command
Command options generates tmux option and hook metadata and typed value surfaces.
Command options generates tmux option and hook metadata and typed value surfaces.
goname
Package goname converts tmux and Python lower_snake_case names to the Go exported spelling this module uses.
Package goname converts tmux and Python lower_snake_case names to the Go exported spelling this module uses.
tmuxcmd
Package tmuxcmd contains the private tmux process boundary.
Package tmuxcmd contains the private tmux process boundary.
Package tmuxtest runs your program inside a real tmux and lets a test assert on what it drew.
Package tmuxtest runs your program inside a real tmux and lets a test assert on what it drew.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL