Plan.run
Run this plan, grouping it with planner.
Source and package
- Qualified name
-
libtmux::plan:: Plan:: run - Module
- plan
- Declared in
Plan- Package
- libtmux
- Source
- crates/libtmux/src/plan/run.rs
-
Description#
The result does not depend on the planner; the number of tmux invocations, and how precisely a failure can be attributed, do.
Errors
Returns an error when tmux cannot be reached, a process cannot be captured, a slot dependency is invalid, or a creating operation does not return valid IDs, or a layout is invalid. Validation happens before the first recorded command. Version-sensitive layouts may query metadata. A command tmux refuses is reported through the returned
PlanResult, not as an error, because a plan may expect one.On a handle from
Server::over_control_mode(), a plan holding asuper::ops::Pausefails withcrate::ControlModeErrorKind::BlockingCommandbefore anything is sent, asSelf::run_over_control_mode()does.Cancel safety
The effect can be partial: steps already dispatched stay done, and the
PlanResultnaming them, with the ids of what they created, is lost with the future. A retry runs the whole plan again.
tmux command#
The tmux commands behind run.
capture-pane (the plan has a capture-pane step) kill-pane (the plan has a kill-pane step) kill-window (the plan has a kill-window step) new-session (the plan has a new-session step) new-window (the plan has a new-window step) rename-window (the plan has a rename-window step) run-shell (the plan has a run-shell step) select-layout (the plan has a select-layout step) select-pane (the plan has a select-pane step) select-window (the plan has a select-window step) send-keys (the plan has a send-keys step) set-environment (the plan has a set-environment step) set-option (the plan has a set-option step) split-window (the plan has a split-window step) tmux C API#
The C declarations in tmux that implement these commands.
cmd_capture_pane_entry cmd_capture_pane_exec cmd_kill_pane_entry cmd_kill_pane_exec cmd_kill_window_entry cmd_kill_window_exec cmd_new_session_entry cmd_new_session_exec cmd_new_window_entry cmd_new_window_exec cmd_rename_window_entry cmd_rename_window_exec cmd_run_shell_entry cmd_run_shell_exec cmd_select_layout_entry cmd_select_layout_exec cmd_select_pane_entry cmd_select_pane_exec cmd_select_window_entry cmd_select_window_exec cmd_send_keys_entry cmd_send_keys_exec cmd_set_environment_entry cmd_set_environment_exec cmd_set_option_entry cmd_set_option_exec cmd_split_window_entry cmd_split_window_exec Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.
Create a session and its first pane
- 1
cmd_new_session_exec - calls → 2
spawn_window - calls → 3
spawn_pane - calls → 4
window_add_pane - calls → 5
window_pane_create
Split a window
- 1
cmd_split_window_exec - references → 2
spawn_pane - calls → 3
window_add_pane - calls → 4
window_pane_create