Terminal¶
Terminal management and interaction.
Terminal
¶
VS Code terminal instance.
Initialize a Terminal instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
VSCodeClient
|
The VSCodeClient instance |
required |
terminal_id
|
str
|
Unique identifier for this terminal |
required |
name
|
Optional[str]
|
Optional name of the terminal |
None
|
Source code in vscode_sockpuppet/terminal.py
send_text
¶
Send text to the terminal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text to send to the terminal |
required |
add_new_line
|
bool
|
Whether to add a new line after the text |
True
|
Returns:
| Type | Description |
|---|---|
dict
|
Success status |
Example
terminal.send_text("echo 'Hello, World!'") terminal.send_text("cd /path/to/dir", add_new_line=True)
Source code in vscode_sockpuppet/terminal.py
show
¶
Show the terminal in the UI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preserve_focus
|
bool
|
If true, the terminal will not take focus |
True
|
Returns:
| Type | Description |
|---|---|
dict
|
Success status |
Example
terminal.show(preserve_focus=False) # Show and focus terminal.show() # Show without taking focus
Source code in vscode_sockpuppet/terminal.py
hide
¶
Hide the terminal from the UI.
Returns:
| Type | Description |
|---|---|
dict
|
Success status |
Example
terminal.hide()
dispose
¶
Dispose the terminal, closing it permanently.
Returns:
| Type | Description |
|---|---|
dict
|
Success status |
Example
terminal.dispose()