LibTmux.New-TmuxServer
Construct a tmux endpoint handle without contacting it.
Source and package
- Qualified name
-
LibTmux\ New-Tmux Server - Declared in
LibTmux- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/NewTmuxServerCommand.cs
- Name (default): New-TmuxServer [-Socket
Name <System.String >] [-TmuxBinary <SystemPath .String >] [-ConfigurationFile <System.String >] [<CommonParameters >]Path: New-TmuxServer -SocketPath <System.String > [-TmuxBinary <SystemPath .String >] [-ConfigurationFile <System.String >] [<CommonParameters >] -
Description
Choose a socket name or absolute socket path. Construction performs no tmux I/O and does not start or own a daemon. A later command explicitly acquires data or changes tmux.
Omitting both socket parameters passes tmux no socket, so tmux picks the server: the one the TMUX variable names inside a tmux pane, otherwise its default socket. Two variables choose a socket for such a handle. LIBTMUX_SOCKET_PATH becomes
-Sand LIBTMUX_SOCKET becomes-L; when both are set the path wins, and a blank value counts as unset. A parameter beats both variables. The handle reads the variables when it is made. LIBTMUX_SOCKET_NAME, which earlier versions read, selects nothing.What is on here. Most cmdlets in the module start from the handle this one returns. They take it directly, or take a session, window, pane or client that was read through it. The cmdlets fall into a few groups:
- Connecting
New-TmuxServerbuilds the handle.Connect-TmuxServerdiscovers the live server behind it and returns a connected replacement, andGet-TmuxServerreads the daemon's identity and version without starting one.Connect-TmuxControlopens a control client andDisconnect-TmuxControlcloses it.- Finding one thing
Get-TmuxSessionandGet-TmuxWindowselect by id or name,Get-TmuxPaneby id, andGet-TmuxClientby name. A selector that matches nothing emits nothing.Get-TmuxClientAttachmentresolves the session, window and pane a client is viewing.- Listing everything
Get-TmuxSession,Get-TmuxWindow,Get-TmuxPaneandGet-TmuxClientlist everything on the server when given no selector. A missing daemon writes an error instead of returning an empty list.Get-TmuxSnapshotcaptures the hierarchy to a depth you choose and returns a replacement server.Update-TmuxPaneandUpdate-TmuxClientread one object again into a new capture.- Querying things and getting around
New-TmuxQuerybuilds reusable criteria.Select-TmuxSession,Select-TmuxWindowandSelect-TmuxPanefilter objects you already captured without contacting tmux, and can require exactly one match.Invoke-TmuxQueryacquires fresh objects instead.Get-TmuxQueryFieldlists the fields and operators,Get-TmuxQueryPlanshows how a query will run, andConvertTo-TmuxQueryJsonserializes one. To move down the hierarchy, pass a session toGet-TmuxWindoworGet-TmuxPane, or a window toGet-TmuxPane.- Changing things
New-TmuxSession,New-TmuxWindow,Split-TmuxPaneandNew-TmuxWindowLinkcreate, andNew-TmuxSessioncan start a daemon that is not running yet.Rename-TmuxSessionandRename-TmuxWindowrename, andMove-TmuxWindow,Set-TmuxLayout,Set-TmuxPaneSizeandSet-TmuxWindowSizerearrange.Remove-TmuxSession,Remove-TmuxWindow,Remove-TmuxWindowLinkandRemove-TmuxPanedelete, andStop-TmuxServerends the whole server.- Options and hooks
Get-TmuxOption,Set-TmuxOptionandRemove-TmuxOptionread, write and unset options on a server, session, window or pane.Get-TmuxHook,Set-TmuxHookandRemove-TmuxHookdo the same for hooks, andInvoke-TmuxHookruns one now.Get-TmuxEnvironment,Set-TmuxEnvironmentandRemove-TmuxEnvironmentmanage the environment table of a server or session.- Everything else tmux keeps
Send-TmuxTextandSend-TmuxKeytype into a pane,Get-TmuxPaneContentreads what it shows, andWait-TmuxPaneTextwaits for text to appear.Invoke-TmuxPaneCommandruns a shell command in a pane and reports its exit status.Wait-TmuxChannelwaits for a channel signal, andWatch-TmuxEventstreams events from a control client.- Things that need a terminal
Enter-TmuxSessionattaches your foreground terminal to a session and returns when you detach. Run it outside tmux; it rejects redirected input.- Running a command
- Anything tmux can do that is not here is reachable through
Invoke-TmuxCommand, which runs literal tmux arguments and returns the result.Invoke-TmuxChainruns several commands in order,New-TmuxCommandbuilds one without running it, andInvoke-TmuxControlCommandsends one over a control client.
Notes
The returned
LibTmux.Serveris unmaterialized. TmuxBinaryPath andConfigurationFileaffect subsequent operations; construction does not execute them.Command details
- Command type
cmdlet- Default parameter set
- Name
- Positional binding
- Enabled.
- Outputs
LibTmux.Server
- Parameters
-
-
-SocketName(System.String ) forNameThe tmux socket name, passed as
-L. It beats LIBTMUX_SOCKET and LIBTMUX_SOCKET_PATH.- Required
- No
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-TmuxBinaryPath(System.String )The tmux executable used by subsequent operations.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-ConfigurationFile(System.String )The configuration used if a later operation starts tmux.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-SocketPath(System.String ) forPathThe absolute socket path, passed as
-S. It beats LIBTMUX_SOCKET and LIBTMUX_SOCKET_PATH.- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
Common parameters 12
PowerShell supplies these parameters. See common parameter behavior for their effects.
-
-Verbose(System.Management ).Automation .Switch Parameter Display verbose messages produced by this command.
Aliases:vbMicrosoft Learn reference -
-Debug(System.Management ).Automation .Switch Parameter Display debug messages produced by this command.
Aliases:dbMicrosoft Learn reference -
-ErrorAction(System.Management ).Automation .Action Preference Choose how this command responds to non-terminating errors.
Aliases:eaMicrosoft Learn reference -
-WarningAction(System.Management ).Automation .Action Preference Choose how this command responds to warning messages.
Aliases:waMicrosoft Learn reference -
-InformationAction(System.Management ).Automation .Action Preference Choose how this command handles information messages.
Aliases:infaMicrosoft Learn reference -
-ProgressAction(System.Management ).Automation .Action Preference Choose how this command handles progress updates.
Aliases:progaMicrosoft Learn reference -
-ErrorVariable(System.String )Store the command's error records in the named variable.
Aliases:evMicrosoft Learn reference -
-WarningVariable(System.String )Store the command's warning records in the named variable.
Aliases:wvMicrosoft Learn reference -
-InformationVariable(System.String )Store the command's information records in the named variable.
Aliases:ivMicrosoft Learn reference -
Save output in the named variable while passing it down the pipeline.
Aliases:ovMicrosoft Learn reference -
Buffer output before passing it to the next pipeline command.
Aliases:obMicrosoft Learn reference -
-PipelineVariable(System.String )Make the most recent output object available through a named variable within the pipeline.
Aliases:pvMicrosoft Learn reference
-
- Returns
-
LibTmux.Server: Native pipeline type for this command.
Examples
Example 1 Construct a handle for the existing socket identified by
$SocketPath. View sourceTerminal window LibTmux\New-TmuxServer -SocketPath $SocketPath
Recorded calls
source callsThe PowerShell reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux\New-TmuxServer.
Guides
task materialPages that discuss New-TmuxServer.
- Topics
In other ports
task equivalence 22 other ports mappedSource-verified mappings for A tmux server. A mapping says these APIs perform the same task. It does not say they share defaults, errors or completion: check each page.
| Port | API | Differs from PowerShell |
|---|---|---|
| PowerShell | Lib Construct a tmux endpoint handle without contacting it. | This page |
| Python | libtmux tmux(1) Server [server_manual]. | None recorded in the model |
| Ruby | Lib Connects to an existing endpoint. Closing retires clients, never the daemon. | None recorded in the model |
| Lua | libtmux | None recorded in the model |
| Julia | Lib Describe a tmux endpoint without contacting it. Supply exactly one socket selector. A description does not own a daemon or any sessions. Use from_env to opt into the ambient tmux endpoint. | |
| Erlang | tmux Open tmux endpoints and execute explicit command values. | open/1 observes an existing daemon and starts an endpoint owner. Domain rows remain immutable values. |
| Elixir | Lib An explicit local tmux server descriptor. | Server describes an existing server by executable and socket. It neither connects nor reserves the server’s identity. |
| Haskell | Lib Start, observe and change a tmux daemon through a scoped handle. | LibTmux.Server owns the Server handle. withOwnedServer starts and retires a private daemon; withServer borrows an existing endpoint and releases its own resources afterwards. killServer retires the admitted daemon generation explicitly. Operations such as capture and renameSession are functions of this module that take the handle. |
| Common Lisp | libtmux: A connection scope with one external-operation lease.
Closing cancels owned work and leaves the tmux daemon alive. Captured data may
outlive the client. Public operations never expose its mutable storage. | |
| TypeScript | server One tmux server, addressed by the socket it listens on. | None recorded in the model |
| Rust | server A cloneable handle to one captured tmux server endpoint. | None recorded in the model |
| Go | tmux Server is an immutable handle to one tmux configuration. Its zero value is invalid. Copying a configured Server preserves its configuration and shares its mutex-guarded version cache and checked daemon identity, so a Server and the values derived from it are safe for concurrent method calls (see the package documentation). | None recorded in the model |
| Java | io Manages sessions, windows, and panes on a tmux server. | readonly |
| Clojure | libtmux Opens local resources for an explicit :socket-path or :socket-name endpoint. | Opens a closeable Java server client for an explicit endpoint. Acquisitions return persistent maps with explicit Java references for effects. |
| Kotlin | io Manages sessions, windows, and panes on a tmux server. | None recorded in the model |
| Scala | io The Java client, opaque: every member beyond java.lang.AutoCloseable#close is an extension, generated from the operation catalog or handwritten where the catalog marks it WAIT, STREAM or LIFECYCLE. Closing an owned client releases its transport, not tmux; close() comes from the AutoCloseable bound with no forwarding of its own, so Using.resource(server) { ... } works. | None recorded in the model |
| C# | Lib Represents an immutable server handle and snapshot. | None recorded in the model |
| F# | Lib Starts server reads and queries with the caller's cancellation token. | This F# module provides functions over the shared .NET LibTmux.Server type. |
| C++ | libtmux:: One tmux server, addressed by the socket it listens on. | None recorded in the model |
| Swift | Server A tmux server, addressed by its endpoint. | None recorded in the model |
| OCaml | Libtmux An explicit generation-bound connection. Applications retain ownership of the endpoint choice and resource lifetime. | A client is a live, generation-bound server connection. Endpoint describes a socket without connecting; closing a client releases its resources. |
| Perl | Lib Explicit tmux acquisition and commands | Construction records connection settings without tmux I/O. Optional LibTmux::Async::Server returns standard Future results for operations. |
| Raku | Lib | None recorded in the model |