Core LibraryAPI Reference

Choose documentation 2

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

cmdlet libtmux-powershell latest

LibTmux.New-TmuxWindow

LibTmux\New-TmuxWindow LibTmux\New-TmuxWindow

Create a window in an explicit session.

Source and package
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.

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.

Discussed in Create sessions, windows and panes

Esc

Type to search.

Reference preview Open reference