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.

method libtmux-ts latest

Session.newWindow

Create a window in this session and resolve it as a handle.

Source and package
Qualified name
Session.newWindow
Module
session
Declared in
Session
Package
libtmux
Source
packages/libtmux/src/session.ts
Other languages
PowerShell Julia Elixir PythonRubyLuaRustGoJavaC#C++SwiftKotlinScala F#

Description#

The handle costs a snapshot of the whole server, not of this session: a window made here is linked into every session grouped with it, and the handle reports those links. When the id is enough, server.pipeline([session.plan.newWindow().argv]) returns it for one command, whatever the server's size.

index selects an exact slot. An occupied slot fails without replacing its window; omitting index leaves placement to tmux.

Examples#

const created = await session.newWindow({ index: 3, name: "editor" });
created.name; // "editor"
created.index; // 3
Parameters
Raises
  • TypeError – when index is outside 0 through 2147483647, is not an integer, or is combined with direction.

tmux command#

The tmux commands behind newWindow.

tmux C API#

The C declarations in tmux that implement these commands.

Guides#

Pages that discuss newWindow.

In other ports#

Create a window

Esc

Type to search.

Reference previewOpen reference