Core Library0.xAPI Reference

Choose documentation 2

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.

cmdlet libtmux-powershell latest

LibTmux.New-TmuxWindow

Create a window in an explicit session.

Source and package
Qualified name
LibTmux\New-TmuxWindow
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/NewTmuxWindowCommand.cs

Description#

Create a window and its initial pane, then return the captured native LibTmux.Window. Supply a native Session directly or through the pipeline. The new window remains unselected unless Activate is present. The existing session object is not refreshed in place.

Notes

WhatIf performs no core discovery or dispatch and returns no created object. Confirmation precedes the core operation. The caller remains responsible for created resources. Cancellation does not prove that creation was rolled back; no mutation is retried. Per-owner errors use Tmux.WindowCreateFailed and retain the core exception and failed session. ErrorAction Continue allows later owners to run. A name with a colon or a period on exactly tmux 3.7 reports LibTmux.TmuxUnsupportedOnReleaseException as its error before creating the window.

Command details#

Command type
cmdlet
Confirmation
Supports -WhatIf and -Confirm; confirm impact: Medium.
Positional binding
Enabled.
Pipeline inputs
LibTmux.Session: Native pipeline type for this command.
Outputs
LibTmux.Window

Examples#

Example 1 Create a named window at an unused index in the first session on the server identified by $SocketPath. This example requires /bin/sh and leaves the new window running for later work. View source

Terminal window
LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\Get-TmuxSession | Select-Object -First 1 |
LibTmux\New-TmuxWindow -Name 'help-window' -Index 5 -Command 'exec /bin/sh'
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.Window: Captured native object for the created resource.

tmux command#

The tmux commands behind New-TmuxWindow.

tmux C API#

The C declarations in tmux that implement these commands.

Guides#

Pages that discuss New-TmuxWindow.

Esc

Type to search.

Reference previewOpen reference