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-TmuxSession

LibTmux\New-TmuxSession LibTmux\New-TmuxSession

Create a detached session on an explicit server.

Source and package
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/NewTmuxSessionCommand.cs

Description#

Create a session and its initial window and pane, then return the captured native LibTmux.Session . The Server parameter accepts a native endpoint handle directly or through the pipeline. The core can start the daemon when that endpoint has no server. Existing session names remain errors; the command does not replace or attach to an existing session.

Notes

WhatIf reports the intended endpoint without discovery, daemon startup or dispatch, and returns no created object. Confirmation precedes the core operation. Success does not transfer ownership of the daemon to the module or arrange automatic cleanup. Cancellation can occur after a session was created; it is not rollback and the module does not retry. Per-owner errors use Tmux.SessionCreateFailed and retain the core exception and failed server. 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.Server : Native pipeline type for this command.
Outputs
LibTmux.Session

Examples#

Example 1 Create a detached session on the server identified by the absolute $SocketPath . Choose an endpoint you control; the created session remains running until you remove it. View source

Terminal window
$options = @{
Name = 'help-session'
WindowName = 'work'
Command = 'exec /bin/sh'
}
LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\New-TmuxSession @options
Parameters
Common parameters 12

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

Returns

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

Discussed in Create windows and panes · Create sessions, windows and panes

Esc

Type to search.

Reference preview Open reference