Repository navigation
fix(repl): keep the slash dropdown open when a command is fully typed - #27
Merged
Merged
Conversation
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.
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.
Bug
Typing
/cosshows 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 (/modestill showed because/modelsalso 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
SLASH_COMMANDS: at every prefix length there is a dropdown entry, none identical to the typed text/costunchanged; skills too/cos,/cost,/modelsruffclean