On this page
Rust API reference
1885 symbols, extracted from source. Every type name in a signature links to its own entry; every cross-reference in a doc comment resolves against the same table.
By module 56 modules
- blocking 1
- capabilities 1
- client 1
- command 9
- config 5
- control 8
- error 13
- formats 8
- freeze 1
- hooks 3
- limits 4
- options 5
- pane 5
- plan 20
- query 11
- server 10
- session 4
- snapshot 13
- src 5
- target 13
- test 11
- version 12
- window 11
- control.actor 12
- control.lifecycle_tests 1
- control.protocol 5
- error.classification 1
- error.refusal 1
- formats.plan 8
- formats.row 9
- formats.text 3
- options.generated 217
- pane.observe 1
- pane.settings 1
- plan.planner 3
- plan.run 9
- plan.wire 14
- query.fields 6
- query.grammar 7
- query.matching 23
- query.private 9
- query.schema 6
- query.serde_v1 18
- server.builder 1
- server.channels 1
- server.discovery 5
- server.interactive 1
- server.settings 1
- session.settings 1
- window.settings 1
- plan.ops.options 2
- plan.ops.panes 5
- plan.ops.sessions 1
- plan.ops.windows 5
- Types 57
Server 18 types
Session 5 types
Window 12 types
Windows compare by server endpoint, session, index, and window id.
Rotation 2 members Layout 9 members LayoutSpec 2 members SplitDirection 5 members PaneSize 2 members ResizeDirection 5 members Window 11 members Window 11 members WindowConfig 12 membersPane 5 types
Hooks 1 type
Options 3 types
Terminal capabilities 1 type
Versions 3 types
Commands 8 types
Control mode 11 types
The public handles backed by one running connection actor.
ReplySlot 2 members ReplySlots 6 members Connection 0 members Line 6 members ControlClientLimits 4 members ControlLimits 6 membersFormats 21 types
One parsed row backed by a single owned unescaped byte buffer.
ParsedSlot 4 members TmuxText 6 membersCompare tmux bytes against a string without converting either.
[u8] 0 members str 0 membersQueries 14 types
A predicate that evaluates a borrowed candidate.
F 0 members QueryIteratorExt 0 members I 0 members FilterEnum 0 membersStable string semantics for a custom enum filter field.
Filterable 0 membersA type with a stable schema that can evaluate portable filter predicates.
ManyRelation 5 members A value-only handle for a to-many relation from From to To.
A value-only handle for a to-one relation from From to To.
A filter target whose portable expression grammar can be described.
FilterSchemaDescriptor 3 members FilterValueSchema 7 members ScalarValue 0 members IntegerValue 0 membersQueries — Fields 6 types
A typed handle for a portable text field on T.
A typed handle for a portable boolean field on T.
A typed handle for a fixed-width integer field N on T.
A typed handle for a custom enum field E on T.
Queries — Operators 3 types
Queries — Expressions 20 types
An opaque, portable predicate over candidates of type T.
One opaque predicate passed to generated candidate dispatch.
FilterExpr 0 members RawNode 0 members RawExpressionSeed 0 members RawExpressionVisitor 0 members FilterExpr 0 members ExpressionRef 0 members ExpressionList 0 membersQueries — Serialisation 12 types
Snapshots 9 types
Workspaces 8 types
Workspaces — Plans 6 types
Workspaces — Steps 12 types
An operation that can be recorded in a [Plan].
An operation that may share one tmux invocation with its neighbours.
FromStep 0 members Turns a recorded step index into whatever Plan::add returns for it.
Workspaces — Targets and slots 11 types
Workspaces — Session 1 type
Workspaces — Window 5 types
Workspaces — Pane 2 types
Requests 3 types
Errors 19 types
Errors — Server 2 types
Errors — Session 1 type
Constants and enums 17 types
The exact status and output captured for one tmux command.
Event 30 members BlockResult 4 members ControlMode 7 members DecoderKind 13 members FormatCodecErrorKind 13 members ReplaceMode 2 members OptionKind 7 members CaptureOptions 10 members PlanValidationErrorKind 5 members PlanResult 5 members FilterExpressionErrorKind 9 members IntegerKind 10 members AccessMode 2 members PromptKind 4 members JoinOptions 4 members SplitOptions 9 membersConstants and enums — Session 1 type
Constants and enums — Window 1 type
Testing utilities 7 types
Other 9 types
Functions and constants 0 types
-
tmux's
activity-actionoption.
-
tmux's
after-bind-keyoption.
-
tmux's
after-capture-paneoption.
-
tmux's
after-copy-modeoption.
-
tmux's
after-display-messageoption.
-
tmux's
after-display-panesoption.
-
tmux's
after-kill-paneoption.
-
tmux's
after-list-buffersoption.
-
tmux's
after-list-clientsoption.
-
tmux's
after-list-keysoption.
-
tmux's
after-list-panesoption.
-
tmux's
after-list-sessionsoption.
-
tmux's
after-list-windowsoption.
-
tmux's
after-load-bufferoption.
-
tmux's
after-lock-serveroption.
-
tmux's
after-new-sessionoption.
-
tmux's
after-new-windowoption.
-
tmux's
after-paste-bufferoption.
-
tmux's
after-pipe-paneoption.
-
tmux's
after-queueoption.
-
tmux's
after-refresh-clientoption.
-
tmux's
after-rename-sessionoption.
-
tmux's
after-rename-windowoption.
-
tmux's
after-resize-paneoption.
-
tmux's
after-resize-windowoption.
-
tmux's
after-save-bufferoption.
-
tmux's
after-select-layoutoption.
-
tmux's
after-select-paneoption.
-
tmux's
after-select-windowoption.
-
tmux's
after-send-keysoption.
-
tmux's
after-set-bufferoption.
-
tmux's
after-set-environmentoption.
-
tmux's
after-set-hookoption.
-
tmux's
after-set-optionoption.
-
tmux's
after-show-environmentoption.
-
tmux's
after-show-messagesoption.
-
tmux's
after-show-optionsoption.
-
tmux's
after-split-windowoption.
-
tmux's
after-unbind-keyoption.
-
tmux's
aggressive-resizeoption.
-
tmux's
alert-activityoption.
-
tmux's
alert-belloption.
-
tmux's
alert-silenceoption.
-
tmux's
allow-passthroughoption.
-
tmux's
allow-renameoption.
-
tmux's
allow-set-titleoption.
-
tmux's
alternate-screenoption.
-
tmux's
assume-paste-timeoption.
-
tmux's
automatic-renameoption.
-
tmux's
automatic-rename-formatoption.
-
tmux's
backspaceoption.
-
tmux's
base-indexoption.
-
tmux's
bell-actionoption.
-
tmux's
buffer-limitoption.
- CAPTURE_LINE_FLAGS : ReleaseVersion
-
capture-pane -F, and socrate::Pane::capture_lines.
- CAPTURE_TRIM_BLANK_CELLS : ReleaseVersion
-
capture-pane -T, and socrate::CaptureOptions::trim_blank_cells.Added in 3.4 to stop at the last used cell instead of the pane's full width. The option string is
ab:CeE:JNpPqS:t:on 3.2a and gainsTby 3.5a; tmux's own CHANGES puts it in the 3.3a-to-3.4 section.-Nand-Pneed no such gate: both are present at 3.2a, which iscrate::TmuxVersion::MIN_SUPPORTED.
-
How long a blocking wait sleeps before looking again.
Sleeping rather than yielding, for the reason [design.md] gives about the async poll loops and which applies with more force here: this runs inside
spawn_blockingwhile waiting for a *process* to exit, so a spin holds a core the daemon needs to handle the signal it was just sent. On a machine with fewer cores than the suite has concurrent fixtures, that is the difference between a clean shutdown and a grace window that expires.[design.md]: ../docs/design.md
-
tmux's
client-activeoption.
-
tmux's
client-attachedoption.
-
tmux's
client-dark-themeoption.
-
tmux's
client-detachedoption.
-
tmux's
client-focus-inoption.
-
tmux's
client-focus-outoption.
-
tmux's
client-light-themeoption.
-
tmux's
client-resizedoption.
-
tmux's
client-session-changedoption.
- CLIENTS_HIDE_STOPPED : ReleaseVersion
-
list-clientsleaving out a client that is stopped rather than gone, and socrate::Error::ClientSuspendedbeing reachable at all.From this release
sort_get_clientsscreens the listing onCLIENT_UNATTACHEDFLAGS, which covers the dead, the exiting and the suspended together, so a suspended or locked client disappears from it. Earlier releases screen on the session alone, and suspending a client never clears that, so it stays listed and reads back normally.Measured on 3.2a, 3.4, 3.5a, 3.6b, 3.7 and 3.7c: the first four list a suspended client, the last two do not.
-
tmux's
clock-mode-colouroption.
-
tmux's
clock-mode-styleoption.
-
tmux's
codepoint-widthsoption.
-
tmux's
command-aliasoption.
-
tmux's
command-erroroption.
- CONTROL_PANE_OFF : ReleaseVersion
-
Taking a pane out of a control client's stream without crashing the server, and so
crate::control::ControlSender::mute_paneusingoff.Before this release `refresh-client -A <pane>:off
leaves the output blocks already queued for that pane in place, while the pane stops holding the server's read buffer back. Writing those blocks later reads past the end of a buffer the server has drained, and the server segfaults.mute_pane` pauses the pane below this release instead, which discards the queue on every supported release.
-
tmux's
copy-commandoption.
-
tmux's
copy-mode-current-line-number-styleoption.
-
tmux's
copy-mode-current-match-styleoption.
-
tmux's
copy-mode-line-number-styleoption.
-
tmux's
copy-mode-line-numbersoption.
-
tmux's
copy-mode-mark-styleoption.
-
tmux's
copy-mode-match-styleoption.
-
tmux's
copy-mode-position-formatoption.
-
tmux's
copy-mode-position-styleoption.
-
tmux's
copy-mode-selection-styleoption.
-
tmux's
cursor-colouroption.
-
tmux's
cursor-styleoption.
-
tmux's
default-client-commandoption.
-
tmux's
default-commandoption.
-
tmux's
default-shelloption.
-
tmux's
default-sizeoption.
-
tmux's
default-terminaloption.
-
tmux's
destroy-unattachedoption.
-
tmux's
detach-on-destroyoption.
-
tmux's
display-panes-active-colouroption.
-
tmux's
display-panes-colouroption.
-
tmux's
display-panes-timeoption.
-
tmux's
display-timeoption.
-
tmux's
editoroption.
-
tmux's
escape-timeoption.
-
How many events may buffer before the connection stops reading tmux.
-
tmux's
exit-emptyoption.
-
tmux's
exit-unattachedoption.
-
tmux's
extended-keysoption.
-
tmux's
extended-keys-formatoption.
-
tmux's
fill-characteroption.
-
tmux's
focus-eventsoption.
-
tmux's
focus-follows-mouseoption.
-
tmux's
get-clipboardoption.
-
How many events may be held while a reply is outstanding.
Reading continues while something is waiting for a reply, because the reply arrives on the connection that would otherwise pause. That is bounded by how long a reply takes, and tmux answers most commands at once -- but not all.
run-shellwithout-banswers its own block immediately and then parks the queue for as long as its shell command runs, so the next command sent is outstanding for that long and this end would hold events for the duration. A ceiling turns that into a pause rather than a memory leak.
-
tmux's
history-fileoption.
-
tmux's
history-limitoption.
-
tmux's
initial-repeat-timeoption.
-
tmux's
input-buffer-sizeoption.
-
tmux's
key-tableoption.
-
tmux's
lock-after-timeoption.
-
tmux's
lock-commandoption.
-
tmux's
main-pane-heightoption.
-
tmux's
main-pane-widthoption.
-
tmux's
menu-border-linesoption.
-
tmux's
menu-border-styleoption.
-
tmux's
menu-selected-styleoption.
-
tmux's
menu-styleoption.
-
tmux's
message-command-styleoption.
-
tmux's
message-formatoption.
-
tmux's
message-limitoption.
-
tmux's
message-lineoption.
-
tmux's
message-styleoption.
- MIRRORED_LAYOUTS : ReleaseVersion
-
The mirrored layouts, and so
crate::Layout::MainHorizontalMirroredandcrate::Layout::MainVerticalMirrored.Below this release
layout_set_lookupdoes not carry those names, and tmux refuses one as it would a typo.
-
tmux's
mode-keysoption.
-
tmux's
mode-styleoption.
-
tmux's
monitor-activityoption.
-
tmux's
monitor-belloption.
-
tmux's
monitor-silenceoption.
-
tmux's
mouseoption.
-
What tmux says when it has no client to act on.
-
What tmux says when it holds no session to resolve a target against.
-
What tmux says when a move has nowhere to go.
Reported as a command failure, but it is an ordinary state rather than a fault: a session holding one window has no next window and never will. Navigation reports it as absence so a caller does not have to tell the two apart by reading text.
-
tmux's
other-pane-heightoption.
-
tmux's
other-pane-widthoption.
-
tmux's
pane-active-border-styleoption.
-
tmux's
pane-base-indexoption.
-
tmux's
pane-border-formatoption.
- PANE_BORDER_FORMAT_PER_PANE : ReleaseVersion
-
pane-border-formatbecoming a pane option as well as a window one.Below this release tmux stores it only per window, and a write sent with
-plands there instead -- reporting success for a change the caller did not ask for. Seecrate::OptionSchema::accepts.
-
tmux's
pane-border-indicatorsoption.
-
tmux's
pane-border-linesoption.
-
tmux's
pane-border-statusoption.
-
tmux's
pane-border-styleoption.
- PANE_BORDER_STYLE_PER_PANE : ReleaseVersion
-
pane-border-styleandpane-active-border-stylebecoming pane options as well as window ones, with the same consequence below it as [PANE_BORDER_FORMAT_PER_PANE].
-
tmux's
pane-coloursoption.
-
tmux's
pane-diedoption.
-
tmux's
pane-exitedoption.
-
tmux's
pane-focus-inoption.
-
tmux's
pane-focus-outoption.
-
tmux's
pane-mode-changedoption.
-
tmux's
pane-scrollbarsoption.
-
tmux's
pane-scrollbars-positionoption.
-
tmux's
pane-scrollbars-styleoption.
-
tmux's
pane-set-clipboardoption.
-
tmux's
pane-status-current-styleoption.
-
tmux's
pane-status-styleoption.
-
tmux's
pane-title-changedoption.
-
tmux's
popup-border-linesoption.
-
tmux's
popup-border-styleoption.
-
tmux's
popup-styleoption.
-
tmux's
prefixoption.
-
tmux's
prefix-timeoutoption.
-
tmux's
prefix2option.
-
tmux's
prompt-command-cursor-styleoption.
-
tmux's
prompt-cursor-colouroption.
-
tmux's
prompt-cursor-styleoption.
- PROMPT_HISTORY : ReleaseVersion
-
The prompt history, and so
crate::Server::prompt_history.
-
tmux's
prompt-history-limitoption.
-
Bytes that
#{q:}prefixes with a backslash.This is tmux's
format_quote_shellset. None of these bytes is an octal digit or one of the lettersvisemits, so the two escaping layers below compose into one unambiguous grammar.
-
tmux's
remain-on-exitoption.
-
tmux's
remain-on-exit-formatoption.
-
tmux's
renumber-windowsoption.
-
tmux's
repeat-timeoption.
-
tmux's
scroll-on-clearoption.
- SERVER_ACCESS : ReleaseVersion
-
server-access, and socrate::Server::access_rules.
-
tmux's
session-closedoption.
-
tmux's
session-createdoption.
-
tmux's
session-renamedoption.
-
tmux's
session-status-current-styleoption.
-
tmux's
session-status-styleoption.
-
tmux's
session-window-changedoption.
-
tmux's
set-clipboardoption.
-
tmux's
set-titlesoption.
-
tmux's
set-titles-stringoption.
-
tmux's
silence-actionoption.
-
tmux's
statusoption.
-
tmux's
status-bgoption.
-
tmux's
status-fgoption.
-
tmux's
status-formatoption.
-
tmux's
status-intervaloption.
-
tmux's
status-justifyoption.
-
tmux's
status-keysoption.
-
tmux's
status-leftoption.
-
tmux's
status-left-lengthoption.
-
tmux's
status-left-styleoption.
-
tmux's
status-positionoption.
-
tmux's
status-rightoption.
-
tmux's
status-right-lengthoption.
-
tmux's
status-right-styleoption.
-
tmux's
status-styleoption.
-
tmux's
synchronize-panesoption.
-
tmux's
terminal-featuresoption.
-
tmux's
terminal-overridesoption.
-
tmux's
tiled-layout-max-columnsoption.
-
tmux's
tree-mode-preview-formatoption.
-
tmux's
tree-mode-preview-styleoption.
-
tmux's
update-environmentoption.
-
tmux's
user-keysoption.
-
tmux's
variation-selector-always-wideoption.
-
tmux's
visual-activityoption.
-
tmux's
visual-belloption.
-
tmux's
visual-silenceoption.
-
tmux's
window-active-styleoption.
-
tmux's
window-linkedoption.
-
tmux's
window-pane-current-status-formatoption.
-
tmux's
window-pane-status-formatoption.
-
tmux's
window-sizeoption.
-
tmux's
window-status-activity-styleoption.
-
tmux's
window-status-bell-styleoption.
-
tmux's
window-status-current-formatoption.
-
tmux's
window-status-current-styleoption.
-
tmux's
window-status-formatoption.
-
tmux's
window-status-last-styleoption.
-
tmux's
window-status-separatoroption.
-
tmux's
window-status-styleoption.
-
tmux's
window-styleoption.
-
tmux's
window-unlinkedoption.
-
tmux's
word-separatorsoption.
-
tmux's
wrap-searchoption.
-
tmux's
xterm-keysoption.
-
Serialize one argument.
-
Render one
NAME=VALUEpair for tmux's-eflag.Built from bytes because tmux accepts environment values that are not valid UTF-8, and rejecting them here would be stricter than tmux is.
- decode_ascii ( slot : ParsedSlot<_> ) Result<&str, FormatCodecError>
- decode_text ( slot : ParsedSlot<_> ) TmuxText
-
Copy a text slot into an exact byte-preserving public value.
- filter_schema ( ) FilterSchemaDescriptor
- for_profile_selection_test ( profile : ListProfile , version : &TmuxVersion , supplements : &'static [&'static FormatDescriptor] ) FormatPlan
-
Describe a live session as a workspace.
The result is a [
Workspace], so it can be rendered withWorkspace::to_yamlor handed straight back tocrate::WorkspaceBuilderto make another like it.A pane is described by the command tmux says it is running. For a pane sitting at a shell that is the shell itself, which would restart as an empty pane -- correct, and rarely what was meant. Panes running something are the ones worth freezing.
Errors
Returns an error when the session's windows or panes cannot be listed.
Examples
use libtmux::{SplitDirection, SplitOptions}; use tmux_workspace::freeze; let guard = libtmux::test::TestServer::new().await?; let session = guard.server().new_session("built-by-hand").await?; let mut window = session.active_window().await?.expect("a window"); window.split(SplitOptions::new(SplitDirection::Below)).await?; let workspace = freeze(&session).await?; assert_eq!(workspace.session_name, "built-by-hand"); assert_eq!(workspace.windows.len(), 1); assert_eq!(workspace.windows[0].panes.len(), 2); // And it round-trips through the file format. let yaml = workspace.to_yaml(); assert_eq!(tmux_workspace::Workspace::from_yaml(&yaml)?, workspace); guard.shutdown().await?;
- hydrate_client_infos_from_stdout ( plan : &FormatPlan , stdout : &[u8] ) Result<Vec<ClientInfo>, FormatCodecError>
- hydrate_pane_projections_from_stdout ( server_identity : &ServerIdentity , plan : &FormatPlan , stdout : &[u8] ) Result<Vec<PaneProjection>, FormatCodecError>
- hydrate_session_infos_from_stdout ( plan : &FormatPlan , stdout : &[u8] ) Result<Vec<SessionInfo>, FormatCodecError>
-
Decode a complete
list-sessionsstdout into ordered snapshots.Sessions and clients are intrinsic rather than projected, so they carry no winlink edge and need no server identity. Order is tmux's own.
- hydrate_window_projections_from_stdout ( server_identity : &ServerIdentity , plan : &FormatPlan , stdout : &[u8] ) Result<Vec<WindowProjection>, FormatCodecError>
-
Serialize an ID as the text tmux prints for it.
- integer_field ( target : &static str , field : &static str ) IntegerField<T, N>
-
The same, for a list of key names an operation sends.
- many_relation ( target : &static str , field : &static str ) ManyRelation<From, To>
- one_relation ( target : &static str , field : &static str ) OneRelation<From, To>
- open ( child : PersistentChild , limits : ControlLimits , timeout : Duration ) Result<OpenedConnection, Error>
-
Take ownership of a control process and wait until tmux has attached it.
- option_schema ( name : &str ) Option<&static OptionSchema>
-
-
The same, for the name/value pairs an operation carries.
- pane_projection_plan ( version : &TmuxVersion ) Result<FormatPlan, FormatCodecError>
-
Read one argument back.
-
Read an ID back from that text.
-
Read that list back.
-
Read back an argument a command may omit.
-
Read those pairs back.
-
-
Read and classify one protocol line.
pendingcarries a line across calls.read_untilappends what it read before it was cancelled, which is what makes this usable inselect!--read_linewould lose those bytes, and would also reject the pane output that is not UTF-8.
-
Read one line, classifying it for the block it arrived in.
withinnames the open block, if any. tmux(1) guarantees a notification never appears inside an output block, so every line but its own terminator is command output -- including one that looks like a notification, which is whatlist-panes -F '#{pane_id}'produces for every row.
- reap_abandoned_servers ( older_than : Duration ) Result<Vec<PathBuf>, TestServerError>
-
Kill tmux servers left behind by fixtures that never cleaned up.
A [
TestServer] removes its own daemon and directory. One whose process was killed mid-run cannot, and the daemon it left keeps running: each holds a pseudo-terminal for every pane it has, and a system has a few thousand. Enough abandoned runs and the nextforkfails withNo space left on device, which reads as a bug in whatever ran next.Only this crate's own fixtures are considered: a directory under
/tmp/libtmux-rs-test, owned by this user, holding a socket where a fixture puts one. A tmux server started any other way -- including one belonging to another libtmux on the same machine -- is never touched, so this cannot reach a real session.Abandonment is read from the process that made the fixture, not guessed from a timestamp: each one records its owner, and a fixture is only reaped once that process is gone. A recycled process id makes this skip a leftover rather than reap a live one, which is the direction to fail in.
older_thanis a second guard on top, for a fixture whose owner id has been reused; passDuration::ZEROto rely on the owner check alone.Errors
Returns an error when the temporary root cannot be read. A directory that cannot be reaped is skipped rather than failing the sweep, because one unreadable leftover should not stop the rest being cleared.
Examples
use std::time::Duration; // Nothing this old is in use, so nothing a running test owns is at risk. let reaped = libtmux::test::reap_abandoned_servers(Duration::from_secs(3600))?; println!("reaped {} abandoned fixtures", reaped.len());
- resolve_server_endpoint ( explicit_path : Option<&OsStr> , socket_name : Option<&OsStr> , inputs : EndpointInputs<_> ) Result<ResolvedEndpoint, IdentityError>
- resolve_server_identity ( explicit_path : Option<&OsStr> , socket_name : Option<&OsStr> , inputs : EndpointInputs<_> ) Result<ServerIdentity, IdentityError>
- retry_until ( within : Duration , condition : impl AsyncFnMut() -> bool ) Result<(), RetryTimeout>
-
Poll until a condition holds, or the deadline passes.
tmux applies most changes asynchronously, so a test that reads straight back can observe the state before the change. This waits for the state the test is about rather than sleeping a fixed amount, which is both faster and not tied to how loaded the machine is.
Errors
Returns [
RetryTimeout] when the condition did not hold before the deadline. The condition's own errors are its business; returnfalseto keep waiting.Examples
use std::time::Duration; use libtmux::test::retry_until; let mut polls = 0; retry_until(Duration::from_secs(5), async || { polls += 1; polls >= 3 }) .await?; assert_eq!(polls, 3);Discussed in Waiting and retrying
- session_id_schema ( generator : &mut schemars::SchemaGenerator ) schemars::Schema
- set_matches ( operator : SetOperator , values : &[T] , candidate : &T ) bool
-
Evaluate one operator against its operands.
Ordering compares against the single bound
has_valid_shaperequires; a malformed predicate that reached here matches nothing rather than panicking on an absent bound.
- set_once_eq ( cell : &OnceLock<T> , value : T , error_kind : FilterExpressionErrorKind ) Result<(), FilterExpressionError>
-
Undo the escaping tmux applies to
%output.tmux writes a byte below
0x20as\oooand a backslash as\\, and leaves everything else alone -- so a pane emitting Latin-1 or binary produces a line that is not UTF-8. Anything else after a backslash is not an escape tmux produces, so it is kept as written rather than guessed at.
- unknown_field_error ( ) FilterExpressionError
- validate_expression ( expression : &ExprData ) Result<(), FilterExpressionError>
- validate_wire_fields ( expression : &ExprData ) Result<(), FilterExpressionError>
- validate_wire_targets ( expression : &ExprData , expected_target : Option<&str> ) Result<(), FilterExpressionError>
- window_id_schema ( generator : &mut schemars::SchemaGenerator ) schemars::Schema
- window_projection_plan ( version : &TmuxVersion ) Result<FormatPlan, FormatCodecError>
-
Write one command line to the connection.
- IndexedHooks : SparseValues<TmuxText>
-
The commands one hook name holds.
A hook is an array option whose values are tmux commands, so this is the [
SparseValues] of that shape rather than a type of its own.Examples
use libtmux::{IndexedHooks, ReplaceMode, TmuxText}; use std::collections::BTreeMap; let guard = libtmux::test::TestServer::new().await?; let server = guard.server(); // The indices are tmux's own and are sparse: removing one does not renumber // the rest, so the map is keyed rather than positional. let mut entries = BTreeMap::new(); entries.insert(0, TmuxText::from("display-message first")); entries.insert(4, TmuxText::from("display-message fifth")); server .set_hooks("after-new-window", &IndexedHooks::from(entries), ReplaceMode::Replace) .await?; let hooks: IndexedHooks = server.hook("after-new-window").await?.expect("just written"); assert_eq!(hooks.len(), 2); assert_eq!(hooks.indices().copied().collect::<Vec<_>>(), vec![0, 4]); guard.shutdown().await?;