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
Perlmethod Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaRustGoJavaC#C++SwiftKotlinScalaOCaml F# Clojure

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

Equivalents of Create a window in other languages
Language Equivalent
Python libtmux.Session.new_window
Ruby LibTmux::Session#new_window
Lua libtmux.Session:new_window
Erlang tmux_window:create/2
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
Rust session.Session.new_window
Go tmux.Session.NewWindow
Java io.github.libtmux.Session.newWindow
Clojure libtmux.core/new-window!
Kotlin io.github.libtmux.kotlin.Session.newWindow
Scala io.github.libtmux.scaladsl.Session.newWindow
C# LibTmux.Session.CreateWindowAsync
C++ libtmux::Session::new_window
Swift Server.newWindow(in:named:startDirectory:at:environment:shell:)
OCaml Libtmux_unix.Client.create_window
Perl LibTmux::Server::new_window Explicit Server operation. Captured entities remain local observations; use a new snapshot to observe changes.

No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp or F#.

Esc

Type to search.

Reference previewOpen reference