Agent Client Protocol - v0.5.1
    Preparing search index...

    Class TerminalHandle

    Handle for controlling and monitoring a terminal created via createTerminal.

    Provides methods to:

    • Get current output without waiting
    • Wait for command completion
    • Kill the running command
    • Release terminal resources

    Important: Always call release() when done with the terminal to free resources.

    The terminal supports async disposal via Symbol.asyncDispose for automatic cleanup.

    You can use await using to ensure the terminal is automatically released when it goes out of scope.

    Index

    Constructors

    Properties

    id: string

    Methods

    • Kills the terminal command without releasing the terminal.

      The terminal remains valid after killing, allowing you to:

      • Get the final output with currentOutput()
      • Check the exit status
      • Release the terminal when done

      Useful for implementing timeouts or cancellation.

      Returns Promise<KillTerminalResponse>

    • Releases the terminal and frees all associated resources.

      If the command is still running, it will be killed. After release, the terminal ID becomes invalid and cannot be used with other terminal methods.

      Tool calls that already reference this terminal will continue to display its output.

      Important: Always call this method when done with the terminal.

      Returns Promise<void | ReleaseTerminalResponse>

    • Returns Promise<void>