LibTmux.Rename-TmuxSession
Rename a native session and optionally emit its replacement.
Source and package
- Qualified name
-
LibTmux\ Rename-Tmux Session - Declared in
LibTmux- Package
- LibTmux
- Source
- src/LibTmux.PowerShell/RenameTmuxSessionCommand.cs
- Rename-TmuxSession [-Session] <Lib
Tmux > [-Name] <System.Session .String > [-PassThru ] [-WhatIf ] [-Confirm] [<CommonParameters >] -
Description
Rename the supplied native
LibTmux.Session. The endpoint and daemon generation come from that handle, so the session is named by its ID and not by its old name. Only that session changes.With PassThru, return a new
Sessionhandle that carries the new name. The original handle keeps the name it captured and is stale after the rename. Without PassThru, emit no success object. tmux expands the name as a format, so a number sign in it does not survive verbatim.WhatIfperforms no tmux I/O.Notes
Failures use
Tmux.SessionRenameFailedand retain the original core exception, its dispatch information and the failed owner.ErrorActionContinue permits later owners to be processed;ErrorActionStop stops on the first failure. A missing target remains an error. No mutation is retried.Command details
- Command type
cmdlet- Confirmation
- Supports
-WhatIfand-Confirm; confirm impact: Medium. - Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Session: A nativeLibTmux.Sessionselected from an explicit endpoint.- Outputs
LibTmux.Session
- Parameters
-
-
The native session to rename. Select it with
Get-TmuxSessionon the endpoint you intend to change.- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
The new session name. An empty name is rejected before tmux is called.
- Required
- Yes
- Position
- 1
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-PassThru(System.Management ).Automation .Switch Parameter Emit a new
Sessionhandle that carries the new name, read back after the rename.- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
-
-WhatIf(System.Management ).Automation .Switch Parameter Runs the command in a mode that only reports what would happen without performing the actions.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
wi
-
-Confirm(System.Management ).Automation .Switch Parameter Prompts you for confirmation before running the cmdlet.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Aliases
cf
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.Session: With PassThru, one replacement handle for each input. Otherwise no success objects are emitted.
Examples
Example 1 Rename the previously selected
$sessionand emit the replacement handle. Assign the output for subsequent operations. View sourceTerminal window $session | LibTmux\Rename-TmuxSession -Name release -PassThru
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\Rename-TmuxSession.
Guides
task materialPages that discuss Rename-TmuxSession.