Session.newWindow
Create a window in this session and resolve it as a handle.
Source and package
-
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.indexselects an exact slot. An occupied slot fails without replacing its window; omittingindexleaves placement to tmux.Examples#
const created = await session.newWindow({ index: 3, name: "editor" });created.name; // "editor"created.index; // 3- Parameters
- Raises
-
-
Type
Error – whenindexis outside 0 through 2147483647, is not an integer, or is combined withdirection.
-
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
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Rust | session |
| Go | tmux |
| Java | io |
| Kotlin | io |
| Scala | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
No equivalent is recorded in PowerShell, Julia, Elixir or F#.