Terminal
Interactive terminal utilities: selection menus, yes/no prompts, and inline autocomplete.
Usage
Option 1: Import directly
main.py
Option 2: Copy and customize
code
main.py
Quick Start
main.py
Want to customize? Run co copy terminal to get an editable copy.
pick()
Single-select menu with keyboard navigation.
main.py
yes_no()
Simple binary confirmation.
main.py
autocomplete()
Inline dropdown with arrow-key navigation over a list you provide. It's a pure UI component — filtering/search is up to the caller.
main.py
Pair it with connectonion.tui.Input for a text field with built-in @-triggered file autocomplete.
Keyboard Controls
| Key | Action |
|---|---|
| ↑/↓ | Navigate options (pick, autocomplete) |
| 1-9 / letters | Quick select by key (pick, list or dict options) |
| Enter | Confirm selection |
| Esc | Cancel (autocomplete only — pick() has no Esc handler, use Ctrl+C) |
| Ctrl+C / Ctrl+D | Cancel with KeyboardInterrupt (pick, yes_no) |
| y / n | Answer directly (yes_no) |
Customizing
Need to modify terminal utilities? Copy the source to your project:
code
Then import from your local copy:
main.py
ConnectOnion