On this page
App class -- TUI event loop for claudewheel.
#claudewheel.app
#claudewheel.app
TUI event loop, keyboard dispatch, and segment interaction.
#App
TUI application managing the event loop, keyboard handling, and segment interaction.
#run_tui
def run_tui(self) -> dict[str, str | None] | NoneEnter the TUI loop. Returns selections on launch, None on quit.
#_promote_ephemeral
def _promote_ephemeral(self) -> NonePromote ephemeral selections to pinned on disk before launch.
#_run_slow_discovery_thread
def _run_slow_discovery_thread(self) -> NoneBackground thread: run slow discovery and store results.
#_apply_slow_discovery
def _apply_slow_discovery(self) -> NoneMerge slow discovery results into the live segment bar.
Results for the focused segment are deferred to avoid disrupting the user's current interaction. Unfocused segments are updated immediately.
Known limitation: while results are buffered, evaluate_requires() uses the focused segment's pre-discovery options for cross-segment constraint checks. Constraint-based dimming may be briefly stale until defocus.
#_apply_pending_for_segment
def _apply_pending_for_segment(self, seg: Segment) -> NoneApply any deferred discovery results for seg and clear pending state.
#_defocus
def _defocus(self) -> NoneRun deferred-apply housekeeping on the segment about to lose focus.
#_handle_key
def _handle_key(self, key: str) -> str | NoneProcess a keypress and return an action string or None to continue.
#_handle_freeform_key
def _handle_freeform_key(self, key: str, seg: Segment) -> str | NoneHandle keystrokes in freeform editing mode (search buffer active on a freeform segment).
#_handle_install_key
def _handle_install_key(self, key: str) -> str | NoneHandle keystrokes during install confirmation.
#_launch_profile_wizard
def _launch_profile_wizard(self, seg: Segment) -> str | NoneExit TUI, run the profile wizard, create profile, return to TUI.
#_handle_create_key
def _handle_create_key(self, key: str, seg: Segment) -> str | NoneHandle keystrokes while in creation mode.
#_confirm_create
def _confirm_create(self, seg: Segment) -> NoneConfirm creation of a new option.