VS Code Terminal Rename Command Usage
Purpose
This skill standardizes terminal title changes through VS Code’s rename command: workbench.action.terminal.renameWithArg. It reflects the current repository mechanism for tab-title behavior.
When to Use
- •When applying terminal tab title updates.
- •When reverting temporary names back to baseline/default-like names.
- •When validating rename behavior in Extension Development Host.
Inputs
- •Target
vscode.Terminalinstance. - •Sanitized title string.
- •Rename command:
workbench.action.terminal.renameWithArg.
Outputs
- •Terminal tab name changes applied through VS Code command API.
- •Consistent rename behavior with current extension architecture.
Procedure
- •Compute and sanitize the intended terminal name.
- •Ensure the target terminal context is correct.
- •Execute
workbench.action.terminal.renameWithArgwith{ name: <title> }. - •Record/log rename decision for debugability.
Constraints
- •Must:
- •Use
workbench.action.terminal.renameWithArgfor terminal naming behavior. - •Keep rename payload explicit and sanitized.
- •Use
- •Must Not:
- •Use OSC/sequence emission as the primary rename mechanism.
- •Pass undefined/missing rename payloads.
- •Avoid:
- •Mixing multiple rename mechanisms in active runtime logic.
Examples
- •Example 1:
- •Context: A file-run command is detected.
- •Steps:
- •Compute
Python: script.py. - •Sanitize title.
- •Execute rename command for the execution terminal.
- •Compute
- •Expected result:
- •Terminal tab reflects parsed title.
Verification
- •Confirm rename command is invoked with expected payload.
- •Confirm tab name changes in Extension Development Host.