Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

struct libtmux-go latest

NewSessionRequest

NewSessionRequest configures session creation. Server.NewSession creates a detached session; Server.NewSessionConnection also acquires an owned control connection. Its zero value uses tmux defaults. Width and Height are either zero or 1 through 65535; KillExisting requires Name. KillExisting may remove a session before a later creation failure.

Source and package
Qualified name
tmux.NewSessionRequest
Package
tmux
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/session_lifecycle.go
struct tmux.NewSessionRequest

Description#

Server.NewSession copies Environment before validation and retains no map storage; concurrent mutation during the copy is unsafe. Foreground-only tmux flags are not exposed.

Fields8#

NewSessionRequest fields
NameTypeDescription
Command string Command starts the initial pane with this shell command; empty uses tmux's default command.
Environment map[string]string Environment is emitted in lexically sorted key order. The map is not retained; nil and an empty map both add no entries.
KillExisting bool KillExisting removes an existing session named Name before creation.
Name string Name selects the new session name; empty lets tmux generate one.
Height int Height sets the detached session height; zero lets tmux choose.
StartDirectory string StartDirectory expands ~ and ~/... for the current user. Named-user forms such as ~other are rejected; empty inherits tmux's default. A directory that does not exist is not an error: tmux starts the process in the home directory instead, or in / without one.
Width int Width sets the detached session width; zero lets tmux choose.
WindowName string WindowName names the initial window; empty lets tmux choose.

Guides#

Pages that discuss NewSessionRequest.

Esc

Type to search.

Reference previewOpen reference