Skip to content

pane_send_input

Asynchronously send text and named keys together through the pane input operation.

Send text and key presses in one pane input operation.

Parameters:

Name Type Description Default
pane_id str

Target pane identifier.

required
text str

Literal text to write before sending keys.

''
keys Sequence[str] | None

Optional key names in the order they should be sent.

None

Returns:

Type Description
OkResult

The server's successful command result.

Example
client = AsyncHerdrClient()
await client.pane_send_input(
    "build", text="printf 'ready\n'", keys=["Enter"]
)
Source code in src/herdr_client/async_client/client.py
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
async def pane_send_input(
    self,
    pane_id: str,
    text: str = "",
    keys: Sequence[str] | None = None,
) -> OkResult:
    """Send text and key presses in one pane input operation.

    Args:
        pane_id: Target pane identifier.
        text: Literal text to write before sending keys.
        keys: Optional key names in the order they should be sent.

    Returns:
        The server's successful command result.

    Example:
        ```python
        client = AsyncHerdrClient()
        await client.pane_send_input(
            "build", text="printf 'ready\\n'", keys=["Enter"]
        )
        ```
    """
    params: PaneSendInputParams = {
        "pane_id": pane_id,
        "text": text,
        "keys": list(keys) if keys is not None else [],
    }
    return await self.request("pane.send_input", params)