fix(cli): simplify Desktop picker controls [skip ci]

Remove numeric shortcuts and their labels so target selection has one visible navigation model: arrow keys followed by Enter. Keep Ctrl+C cancellation and attachment behavior unchanged.

Update the CLI guide and real-key regression tests to verify that 1 and 2 no longer move the highlight.
This commit is contained in:
Xubin Ren committed 2026-09-08 10:04:15 +08:00
1 parent cf74d1c7e5
commit d641026fc8
3 files changed
+4 -6

No files matched your search

+2 -3
View File
@@ -39,9 +39,8 @@ The Python package and Nanobot Desktop keep separate runtimes, configuration,
workspaces, and state. When a running Desktop release publishes its private workspaces, and state. When a running Desktop release publishes its private
terminal-access descriptor, an interactive bare `nanobot` or `nanobot webui` terminal-access descriptor, an interactive bare `nanobot` or `nanobot webui`
asks which installation to use after authenticating a ready Desktop target. asks which installation to use after authenticating a ready Desktop target.
Use `Up`/`Down` to highlight an installation and `Enter` to confirm; `1`/`2` Use `Up`/`Down` to highlight an installation and `Enter` to confirm.
also move the highlight. `Ctrl+C` cancels with exit code 130 without attaching `Ctrl+C` cancels with exit code 130 without attaching to Desktop or starting a Python backend.
to Desktop or starting a Python backend.
If Desktop is absent, busy, unavailable, or cannot be authenticated, the command If Desktop is absent, busy, unavailable, or cannot be authenticated, the command
reports the current Python executable and continues normally. A virtual reports the current Python executable and continues normally. A virtual
environment's executable is shown without resolving it to its base interpreter. environment's executable is shown without resolving it to its base interpreter.
-1
View File
@@ -191,7 +191,6 @@ def _choose_target(status: DesktopReply) -> Literal["desktop", "python"]:
), ),
], ],
default="desktop", default="desktop",
use_shortcuts=True,
instruction="(↑/↓ to move, Enter to confirm, Ctrl+C to cancel)", instruction="(↑/↓ to move, Enter to confirm, Ctrl+C to cancel)",
).unsafe_ask() ).unsafe_ask()
except (EOFError, KeyboardInterrupt): except (EOFError, KeyboardInterrupt):
+2 -2
View File
@@ -216,8 +216,8 @@ def test_absent_desktop_selects_current_python(monkeypatch, capsys) -> None:
("\x1b[B\r", "python"), ("\x1b[B\r", "python"),
("\x1b[B\x1b[A\r", "desktop"), ("\x1b[B\x1b[A\r", "desktop"),
("\x1b[A\r", "python"), ("\x1b[A\r", "python"),
("2\r", "python"), ("2\r", "desktop"), # Numeric keys no longer move the highlight.
("21\r", "desktop"), ("\x1b[B1\r", "python"),
]) ])
def test_target_picker_accepts_real_navigation_keys(keys, expected): def test_target_picker_accepts_real_navigation_keys(keys, expected):
with create_pipe_input() as pipe_input: with create_pipe_input() as pipe_input: