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

Rust API

Rust documentation

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server.rs
Other languages
PythonTypeScriptGoJava.NETC++Swift
new_session ( self , options : impl Into<NewSessionOptions> ) → Result<Session, Error>
method [source]
method [source]
new_session

Create a detached session and return it.

The session is always detached: attaching would take over the calling process's terminal, which a library must not do on its own initiative.

tmux prints the new session through the same format machinery as a listing, so this costs one round trip rather than a create followed by a lookup.

tmux expands the name as a format before it checks it, so #(command) in one runs a shell command. See [the crate documentation][crate#a-name-reaches-tmux-as-a-format] before passing text a caller supplied.

Errors

Returns an error when tmux refuses the command, which includes a name that already exists, and when its output cannot be decoded.

In other ports Create a session

0 declared, 0 inherited

Esc

Type to search.