Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2025-06-10 - Improved TUI prompt UX for headless environments
**Learning:** Using `Prompt.ask` without options makes it unclear what choices the user has in non-interactive mode. However, passing `choices` to rich's `Prompt.ask` makes it case-sensitive, which breaks existing case-insensitivity handling.
**Action:** Manually format choices into the prompt text with escaped brackets `\\[choice1|choice2\\]` to display available options while preserving custom case-insensitive input parsing.
3 changes: 2 additions & 1 deletion libs/terminal_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def _render_selector(self, title, options, selected_index, help_text, default):
def _select_option(self, title, options, default, help_text=None):
if not sys.stdin.isatty():
default_choice = default if default in options else options[0]
answer = Prompt.ask(f"{title}", default=default_choice).strip()
options_str = '|'.join(options)
answer = Prompt.ask(f"{title} \\[{options_str}\\]", default=default_choice).strip()
if answer in options:
return answer
for option in options:
Expand Down
Loading