Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

config.ShellCommand

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

struct config.ShellCommand
structoverload [source]
structoverload [source]
struct config.ShellCommand

One command typed into a pane, with tmuxp's per-command settings.

A file writes it as a string, or as a mapping with cmd and any of enter , sleep_before and sleep_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: false on one command leaves the next one unentered too.

Examples

use tmux_workspace::{ShellCommand, Workspace};
let workspace = Workspace::from_yaml(
"
session_name: demo
windows:
- panes:
- shell_command:
- cd src
- cmd: cargo test
enter: 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));

Members

cmd

cmd : String
attribute [source]
attribute [source]
cmd

The text typed into the pane.

enter

enter : Option<bool>
attribute [source]
attribute [source]
enter

Whether to press Enter after it. None keeps whatever is in force.

sleep_before

sleep_before : Option<Duration>
attribute [source]
attribute [source]
sleep_before

How long to wait before typing it. None keeps whatever is in force.

The wait is a libtmux::plan::Pause, so it happens in tmux and holds the steps after it. tmux keeps typed input until the pane reads it, so a sleep that only waited for a shell to start is not needed.

sleep_after

sleep_after : Option<Duration>
attribute [source]
attribute [source]
sleep_after

How long to wait after typing it. None keeps whatever is in force.

new

new ( cmd : impl Into<String> ) → Self
method [source]
method [source]
new

A command with no settings of its own.

Esc

Type to search.