Chat input widget with prompt, multi-line text, autocomplete, and history.
Features:
ChatInput(
self,
cwd: str | Path | None = None,
history_file: Path | None = None,
image_tracker: ImageTracker | None = None,
**kwargs: Any = {}
)Vertical| Name | Type | Description |
|---|---|---|
cwd | str | Path | None | Default: NoneCurrent working directory for file completion |
history_file | Path | None | Default: NonePath to history file (default: ~/.deepagents/history.jsonl) |
image_tracker | ImageTracker | None | Default: NoneOptional tracker for attached images |
**kwargs | Any | Default: {}Additional arguments for parent |
| Name | Type |
|---|---|
| cwd | str | Path | None |
| history_file | Path | None |
| image_tracker | ImageTracker | None |
Compose the chat input layout.
Initialize components after mount.
Detect input mode and update completions.
Handle text submission.
Always posts the Submitted event - the app layer decides whether to process immediately or queue based on agent status.
Handle history previous request.
Handle history next request.
Handle paste payloads that resolve to dropped file paths.
Handle paste text from app-level routing when input is not focused.
When the text area is mounted, the paste is always consumed: file paths are attached as images, and plain text is inserted directly.
Handle key events for completion navigation.
Post mode changed message and update prompt indicator.
Focus the input field.
Enable or disable the input widget.
Set whether the cursor should be actively blinking.
When active=False (e.g., agent is working), disables cursor blink so the cursor doesn't flash while waiting for a response.
Dismiss completion: clear view and reset controller state.
Render completion suggestions in the popup.
Clear/hide the completion popup.
Handle click on a completion option.
Replace text in the input field.