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

Go API

Go documentation

tmux.Window.NewWindow

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

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. On tmux 3.8 and later, SelectExisting's -S also matches the receiver's own exact target (extended there to match -t as well as a window's name), so it always selects the receiver itself and prints nothing; the identity is already known without a probe. Earlier tmux only matched -S by name here, and always printed a created WindowID because the exact-target form never carries a bare name to match against.

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.