session.Session.cmd
TypeScript
- Python
- Ruby Unavailable
- Lua Unavailable
- TypeScript
- Rust
- Go
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- session
- Declared in
- Session
- Package
- libtmux
- Source
- packages/libtmux/src/session.ts
- Other languages
- Python Ruby Lua RustGo Java .NET C++ Swift
-
Run a tmux command this package does not model, addressed at this session.
The first argument is the tmux command name and nothing else — this does not parse a command line, so arguments go in the array:
The session's id is sent as the target; pass
targetto address something else, ornullfor a command that takes none.In other ports Run a tmux command addressed at a session
- Python
libtmux.Session.cmd - Ruby No source-verified Ruby equivalent is recorded for this operation.
- Lua No source-verified Lua equivalent is recorded for this operation.
- Rust
session.Session.cmd - Go
tmux.Session.Cmd - Java no equivalent on
Session - .NET no equivalent on
Session - C++ no equivalent on
Session - Swift no equivalent on
Session
- Python
Examples
await session.cmd("rename-session", ["--", "renamed"]);>>> session.cmd('new-window', '-P').stdout[0]'libtmux...:....0' From raw output to an enriched Window object:
>>> Window.from_window_id(window_id=session.cmd(... 'new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)Window(@... ...:..., Session($1 libtmux_...))let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("raw").await?;
let result = session .cmd(libtmux::Command::new("display-message").arg("-p").arg("#{session_name}")) .await?;assert_eq!(result.stdout_lossy().trim(), "raw");
guard.shutdown().await?;0 declared, 0 inherited