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

session.NewWindowOptions

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

View as Markdown

Module
session
Package
libtmux
Source
crates/libtmux/src/session.rs
struct session.NewWindowOptions
structoverload [source]
structoverload [source]
struct session.NewWindowOptions

Options for creating a window in a session.

A bare name is accepted wherever this is: session.new_window("editor").

Examples

use libtmux::NewWindowOptions;
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session
.new_window(NewWindowOptions::new("editor").environment("EDITOR", "vi"))
.await?;
assert_eq!(window.name().to_string_lossy(), "editor");
// A bare name works too, because `new_window` takes anything that converts.
session.new_window("logs").await?;
assert_eq!(session.windows().await?.len(), 3);
guard.shutdown().await?;

9 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 window starts.
  • index method Place the window at a window index rather than the first free one.
  • new method Describe a window with the given name, sent literally.
  • placement method Insert relative to the index rather than at it.
  • replace_existing method Replace whatever already occupies the target index.
  • select method Make the new window active in its session.
  • start_directory method Set the window's working directory.
  • unnamed method Describe a window with no name, letting tmux choose one.
Esc

Type to search.