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.

Go API

method libtmux-go latest

Window.NewWindow

NewWindow creates a window relative to the receiver's exact winlink. Set Direction to tmux.NewWindowDirectionAfter or tmux.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.

Source and package
Qualified name
tmux.Window.NewWindow
Package
tmux
Declared in
Window
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/window_lifecycle.go

Description#

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.

tmux command#

The tmux commands behind NewWindow.

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference