Skip to content

fix(repl): keep the slash dropdown open when a command is fully typed - #27

Merged
Amanbig merged 1 commit into
mainfrom
fix/slash-menu-exact-match
Oct 31, 2026
Merged

Amanbig merged 1 commit into
mainfrom
fix/slash-menu-exact-match

Conversation

@Amanbig

@Amanbig Amanbig commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Bug

Typing /cos shows the dropdown with /cost, but as soon as the last letter is typed (/cost) the dropdown disappears, and the same for /models. prompt_toolkit hides a completion that is identical to the text already in the buffer, and when the only match is the typed command that is exactly what happened (/mode still showed because /models also matched).

Reproduced on a virtual terminal before changing anything: /cos -> 1 row, /cost -> 0 rows, /models -> 0 rows.

Fix

On an exact match the completer offers <cmd> (with a trailing space) instead of <cmd>. It differs from the typed text so the entry (and its description) stays visible, and a trailing space is where arguments start anyway. Typing past the command (/cost , /model gpt) still closes the menu. Enter on an exact match submits the typed text unchanged (tested). Applies to built-in commands and skills.

Tests

  • Every command in SLASH_COMMANDS: at every prefix length there is a dropdown entry, none identical to the typed text
  • Exact match inserts a trailing space, case-insensitively; no dropdown once arguments start; Enter submits /cost unchanged; skills too
  • Screen test on the virtual terminal: dropdown still drawn at /cos, /cost, /models
  • Verified they fail without the fix (36 failures); full suite passes (470), ruff clean

prompt_toolkit hides a completion identical to the text already typed, so the
dropdown and its description vanished the moment a command was fully typed
(/cost, /models). On an exact match offer the command with a trailing space,
which differs from the typed text and is where arguments start anyway.
@Amanbig
Amanbig merged commit 302e80e into main Oct 31, 2026
9 of 13 checks passed
@Amanbig
Amanbig deleted the fix/slash-menu-exact-match branch October 31, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant