libtmux Reference MCP Search
On this page

tmux.Window.NewWindow

View as Markdown

Module
tmux
Declared in
Window
Package
github.com/libtmux/libtmux-go/tmux
Source
tmux/window_lifecycle.go
NewWindow ( ctx : context.Context , request : NewWindowRequest ) (Window, error)
method [source]
method [source]
NewWindow

NewWindow creates a window relative to the receiver's exact winlink. Set Direction to NewWindowDirectionAfter or NewWindowDirectionBefore for non-destructive relative creation. With the zero Direction, tmux targets the receiver's occupied index and normally returns a command error; KillExisting can destroy and replace that target. Attach changes the current window only in that target session. Index is rejected before execution because the receiver already supplies the target position. SelectExisting has no no-output recovery on this exact-target form; tmux must print the created WindowID.

If tmux reports an ID before a transport or refresh failure, the partial result contains it and the receiver SessionID with Index -1. Other failures return zero; creation is not rolled back.

0 declared, 0 inherited

Esc

Type to search.