disconnect
Gracefully disconnect from an active terminal session, terminating background commands and releasing all associated resources to prevent resource leaks.
Instructions
Gracefully disconnects from an active terminal session (SSH or local) and cleans up all associated resources.
BEHAVIOR:
- Terminates any running background commands and subprocesses associated with this session.
- Closes open PTY channels, SSH channels, and network sockets to release system resources.
- Removes the session from the active session manager.
USAGE GUIDELINES:
- ALWAYS call this tool when you are finished executing commands on a session to prevent resource leaks (dangling processes/sockets).
- Do NOT call this tool if you intend to run more commands in this session later.
- ALTERNATIVES:
* To see all active sessions before disconnecting, use `list_sessions`.
* To stop a single running command inside the session without closing the entire connection, use `send_control` with "ctrl+c" instead of `disconnect`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The unique session identifier returned by connect_ssh or create_local that you want to close |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |