Skip to content

API Reference parrot.utils.tty

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.utils.tty

View source

Terminal helpers for interactive CLI prompts.

Function restore_stdin_blocking

Put stdin back in blocking mode when the wrapped prompt finishes.

parrot imports install uvloop's event-loop policy, so questionary/prompt_toolkit prompts run on libuv, which sets O_NONBLOCK on fd 0 and never clears it. The flag lives on the shared open file description: a later input() or click.confirm() reads EOF and aborts, and the parent shell inherits the non-blocking tty once the process exits. Wrap every questionary ask() / ask_async() with this context manager.

restore_stdin_blocking() -> Iterator[None]

Returns: Iterator[None]

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally