- Module
- session
- Declared in
- Session
- Package
- libtmux
- Source
- packages/libtmux/src/session.ts
- Other languages
- PythonRubyLuaRustGoJava.NETC++Swift
- newWindow ( options : : NewWindowOptions ) Promise<Window>
-
Create a window in this session and resolve it as a handle.
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.Discussed in Control mode vs one-shot
In other ports Create a window
- Python
libtmux.Session.new_window - Ruby
LibTmux::Session#new_window - Lua
libtmux.Session:new_window - Rust
session.Session.new_window - Go
tmux.Session.NewWindow - Java
io.github.libtmux.Session.Session.newWindow - .NET
LibTmux.Session.CreateWindowAsync - C++
libtmux::Session::new_window - Swift
Server.newWindow(in:named:startDirectory:)
- Python
Examples
const created = await session.newWindow({ name: "editor" });created.name; // "editor">>> window_initial = session.new_window(window_name='Example')>>> window_initialWindow(@... 2:Example, Session($1 libtmux_...))>>> window_initial.window_index'2'>>> window_before = session.new_window(... window_name='Window before', direction=WindowDirection.Before)>>> window_initial.refresh()>>> window_beforeWindow(@... 1:Window before, Session($1 libtmux_...))>>> window_initialWindow(@... 3:Example, Session($1 libtmux_...))>>> window_after = session.new_window(... window_name='Window after', direction=WindowDirection.After)>>> window_initial.refresh()>>> window_after.refresh()>>> window_afterWindow(@... 3:Window after, Session($1 libtmux_...))>>> window_initialWindow(@... 4:Example, Session($1 libtmux_...))>>> window_beforeWindow(@... 1:Window before, Session($1 libtmux_...))0 declared, 0 inherited