config.ShellCommand
This type appears in public signatures. It is not a package entry point.
-
One command typed into a pane, with tmuxp's per-command settings.
Description#
A file writes it as a string, or as a mapping with
cmdand any ofenter,sleep_beforeandsleep_after. A setting given here holds for the commands after it in the same pane until one of them sets its own, because that is what tmuxp does:enter: falseon one command leaves the next one unentered too.Examples#
use tmux_workspace::{ShellCommand, Workspace};let workspace = Workspace::from_yaml("session_name: demowindows:- panes:- shell_command:- cd src- cmd: cargo testenter: false",)?;let commands = &workspace.windows[0].panes[0].shell_commands;assert_eq!(commands[0], ShellCommand::new("cd src"));assert_eq!(commands[1].cmd, "cargo test");assert_eq!(commands[1].enter, Some(false));
Fields4#
| Name | Type | Description |
|---|---|---|
| cmd | String | The text typed into the pane. |
| enter | Option<bool> | Whether to press Enter after it. None keeps whatever is in force. |
| sleep_before | Option<Duration> | How long to wait before typing it. None keeps whatever is in force. |
| sleep_after | Option<Duration> | How long to wait after typing it. None keeps whatever is in force. |