Repository navigation
Conversation
5 of 6 tasks
At a terminal, every numbered question (Gecko build, theme in a repository, version, profile) now also takes the arrow keys: ↑ and ↓ move a › pointer, a typed number moves it too, Enter takes it, Esc stops. The optional-stylesheet menu adds Space to tick and ← → to cross columns; typing 1,3 or all works as before and ticks as you type. Only the menu's own lines are redrawn, and the scrollback ends as the typed answer would. A pipe, CI, TERM=dumb, a terminal under 60 columns or FXCSS_PLAIN_PROMPTS=1 keeps the plain typed prompt. Ctrl+C or Esc now ends with "Stopped." and status 130 instead of a traceback. The stylesheet menu names --with after a choice, like the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamXbot
force-pushed
the
ui/arrow-key-menus
branch
from
November 8, 2026 05:24
72410d8 to
173ecfe
Compare
The interrupt test ran doctor's theme lookup first, which a checkout holding a build/ copy (as after pip install .) finds ambiguous. The Gecko build menu test expected a POSIX folder in the heading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Every numbered question fxcss asks now takes the arrow keys at a terminal, and still takes a typed answer exactly as before.
›pointer (wraps)1,3,20 4,all), ticked as you type.becomes a green✓, so the grid never shifts. The prompt names the keys (Which one? ↑↓ or 1-3 [2]) and its bracket shows what Enter will take.Which one? 1-3 [1] 3), and the chosen row keeps its›or✓.TERM=dumb, a terminal under 60 columns, a menu taller than the terminal, orFXCSS_PLAIN_PROMPTS=1. That last one is for screen readers that cope badly with lines redrawn in place. A retry of the stylesheet question (clashing sheets, or an unreadable token) is typed, because it asks you to retype the list.Also in this PR
Stopped.and exit status 130 instead of a Python traceback. Clean-up still runs in each command's ownfinallyblocks.--withafter a choice (including a, b --with a,b skips this question), like the other four questions.FXCSS_PLAIN_PROMPTS.How it works
fxcss/prompt.py(new, standard library only):arrows_ok()decides between the two modes.decode()turns terminal key sequences into tokens, including modifier forms such as Ctrl+↑.keypresses()reads keys:termioscbreak mode on macOS and Linux, restored however the menu ends;msvcrton Windows, after switching the console to VT mode, and typed prompts if that fails.Frameredraws the menu's lines in place.pick_oneandpick_manyare the two pickers.pick_manyreturns its answer as the text the plain prompt would have read, soscan_selectionand the existing clash and typo checks handle both modes._menunow takes a row renderer instead of pre-drawn lines._menu_rowgainspointer, and always keeps room for(Enter)so rows don't change length as the marker moves.style.columnsgainspointerandticked; with neither set, its output is unchanged.Test plan
python3 -m unittest discover -s tests: 716 tests, 1 skipped (Python 3.14). The new tests also pass on 3.9.tests/test_prompt.py:mainreturning 130 on an interrupt.msvcrtreader and VT switch are written but have not run on a real Windows console. Please tryfxcss installthere before release.fxcss install <theme>with a theme that ships optional stylesheets.🤖 Generated with Claude Code