On this page
tmux.NewWindowRequest
- Module
- tmux
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/window_lifecycle.go
-
NewWindowRequest configures window creation on tmux 3.2a or later. Its zero value uses inherited defaults; placement behavior depends on the receiver.
Session.NewWindowuses tmux's next free index.Window.NewWindowinstead targets the receiver's occupied index and normally returns a command error; KillExisting may replace it.Window.NewWindowrejects Index. SelectExisting may run name-expansion probes before creation.Pointer fields are explicit when nonnil. Methods copy them and Environment before I/O; concurrent mutation during the copy is unsafe.
9 declared, 0 inherited
Members
- Attach attribute Attach lets the created or selected winlink become current in the target session; false preserves its current window.
- Command attribute Command starts the window with this shell command; empty uses tmux's default command.
- Direction attribute Direction places the new winlink relative to the target. Its zero value uses tmux's next free index with Session.NewWindow when Index is nil, but keeps Window.NewWindow on the receiver's occupied target. Use NewWindowDirectionAfter or NewWindowDirectionBefore for non-destructive relative creation through Window.NewWindow.
- Environment attribute Environment is emitted in lexically sorted key order. The map is not retained; nil and an empty map both add no entries.
- Index attribute Index selects an explicit nonnegative winlink index for Session.NewWindow; nil uses the next free index.
- KillExisting attribute KillExisting asks tmux to destroy a window occupying the target index.
- Name attribute Name is omitted when nil. A nonnil empty string remains an explicit -n operand. The value is copied before tmux is called.
- SelectExisting attribute SelectExisting asks tmux to select an existing expanded-name match instead of creating another window. It requires Name.
- StartDirectory attribute StartDirectory expands ~ and ~/... for the current user. Named-user forms such as ~other are rejected; empty inherits tmux's default.