pane.Pane.cmd
Rust
- Python
- TypeScript
- Rust
- Go
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- pane
- Declared in
- Pane
- Package
- libtmux
- Source
- crates/libtmux/src/pane.rs
- Other languages
- PythonTypeScriptGo Java .NET C++ Swift
-
Run a raw tmux command against this pane.
The escape hatch for anything this crate does not wrap.
-tis placed after the subcommand for you, because tmux stops reading flags at the first positional: a target appended after one is taken as text, and the command then succeeds having acted on something else.A non-zero exit status comes back in the
CommandResultrather than as an error, the same ascrate::Server::cmd.Errors
Returns an error when the process cannot be started, captured, or awaited.
In other ports Run a tmux command addressed at a pane
- Python
libtmux.Pane.cmd - TypeScript
pane.Pane.cmd - Go
tmux.Pane.Cmd - Java no equivalent on
Pane - .NET no equivalent on
Pane - C++ no equivalent on
Pane - Swift no equivalent on
Pane
- Python
Examples
let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("raw").await?;let window = session.active_window().await?.expect("a window");let pane = window.active_pane().await?.expect("a pane");
let result = pane .cmd(libtmux::Command::new("display-message").arg("-p").arg("#{pane_id}")) .await?;assert_eq!(result.stdout_lossy().trim(), pane.id().to_string());
guard.shutdown().await?;>>> pane.cmd('split-window', '-P').stdout[0]'libtmux...:...' From raw output to an enriched Pane object:
>>> Pane.from_pane_id(pane_id=pane.cmd(... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=pane.server)Pane(%... Window(@... ...:..., Session($1 libtmux_...)))await pane.cmd("clock-mode");0 declared, 0 inherited