server.NewSessionOptions
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- server
- Package
- libtmux
- Source
- crates/libtmux/src/server.rs
-
Options for creating a session.
A bare name is accepted wherever this is, so the common case stays short:
server.new_session("work").Examples
use libtmux::NewSessionOptions;let guard = libtmux::test::TestServer::new().await?;let server = guard.server();let session = server.new_session(NewSessionOptions::new("work").window_name("editor")).await?;let window = session.active_window().await?.expect("a session has a window");assert_eq!(window.name().to_string_lossy(), "editor");guard.shutdown().await?;
6 declared, 0 inherited
Members
- command method Run a command instead of the default shell.
- environment method Set an environment variable for the process the new session starts.
- new method Describe a session with the given name.
- size method Set the initial size, which a detached session would otherwise default.
- start_directory method Set the working directory for the session's first window.
- window_name method Name the session's first window, literally.