fix(tui): submit exact completion on enter#3593
Merged
esengine merged 1 commit intoJun 8, 2026
Merged
Conversation
dorokuma
pushed a commit
to dorokuma/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
Co-authored-by: lizhengwu <lizhengwu@ksjgs.com>
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.
Summary
Fixes #3592
Fix terminal TUI autocomplete so Enter submits when the currently selected completion item is already fully present in the
input token.
This fixes
/resume 1when both1and10remain in the completion list. Previously, Enter was captured by thecompletion menu and kept accepting the already-inserted
1, so the command did not submit.Changes
completionSelectedInsertPresent()to detect when the selected completion insert already matches the current token./resume 1with both1and10present.Scope
This is limited to TUI autocomplete Enter handling. Tab behavior is unchanged.
The fix is intentionally generic for exact selected inserts, so it also avoids the same stuck-Enter behavior for other
completion menus where the selected item is already fully typed but other prefix matches remain.
Tests
go test ./internal/cli -run 'TestSlashCompletion|TestSlashArgCompletion|TestEnterOnExactMCPSubmitsManager| TestEnterOnMCPWithTrailingSpaceSubmitsManager|TestEnterOnExactSlashArgSubmitsWhenPrefixAlsoMatches| TestCompletionClosesOnSpaceAndNonMatch|TestActiveAtToken|TestMoveCompletionWraps' -count=1go test ./internal/cli -count=1env GOCACHE=/private/tmp/reasonix-gocache go build -o /tmp/reasonix-test ./cmd/reasonixgit diff --check