Skip to content

fix(tui): submit exact completion on enter#3593

Merged
esengine merged 1 commit into
esengine:main-v2from
lizhengwu:fix/resume-exact-completion-enter
Jun 8, 2026
Merged

fix(tui): submit exact completion on enter#3593
esengine merged 1 commit into
esengine:main-v2from
lizhengwu:fix/resume-exact-completion-enter

Conversation

@lizhengwu

Copy link
Copy Markdown
Contributor

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 1 when both 1 and 10 remain in the completion list. Previously, Enter was captured by the
completion menu and kept accepting the already-inserted 1, so the command did not submit.

Changes

  • Add completionSelectedInsertPresent() to detect when the selected completion insert already matches the current token.
  • Let Enter close the completion menu and fall through to normal submission in that exact-match case.
  • Add a regression test for /resume 1 with both 1 and 10 present.

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=1
  • go test ./internal/cli -count=1
  • env GOCACHE=/private/tmp/reasonix-gocache go build -o /tmp/reasonix-test ./cmd/reasonix
  • git diff --check

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) labels Jun 8, 2026
@esengine esengine merged commit 10fecba into esengine:main-v2 Jun 8, 2026
10 checks passed
dorokuma pushed a commit to dorokuma/DeepSeek-Reasonix that referenced this pull request Jun 10, 2026
Co-authored-by: lizhengwu <lizhengwu@ksjgs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TUI /resume exact completion cannot submit when another index shares the same prefix

2 participants