Skip to content

fix(tui): fix Tab key completion in the editor#1012

Merged
liruifengv merged 2 commits into
mainfrom
disable-tab-file
Jun 23, 2026
Merged

fix(tui): fix Tab key completion in the editor#1012
liruifengv merged 2 commits into
mainfrom
disable-tab-file

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

No related issue.

Problem

Two related Tab-key issues in the editor's autocomplete:

  1. Pressing plain Tab while no completion menu is showing opens the file completion list, even though Tab is not a file-mention trigger (@ is). Tab should only accept the selected item when a menu is already open.
  2. After Tab-completing a slash command name (e.g. /go -> /goal), the menu closes and never reopens, so the command's subcommands (e.g. status, pause) are not shown. For commands without subcommands, the completion also fell back to listing files.

What changed

  • Swallow plain Tab in the editor when the autocomplete menu is closed, so it no longer triggers file completion. Tab still accepts the highlighted item while a menu is open.
  • After a slash command name is accepted via Tab, reopen the completion menu so its subcommands appear. The reopen uses non-forced completion so commands without subcommands stay closed instead of falling back to the file list.
  • Added tests covering: Tab is a no-op when the menu is closed, subcommands reopen after slash Tab-accept, and no file-list fallback for commands without subcommands.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Stop plain Tab from opening the file completion list when the autocomplete menu is closed; Tab now only accepts the selected item while the menu is open.

After Tab-completing a slash command name, reopen the menu to show its subcommands instead of falling back to file completions.
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 27e5ec9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@27e5ec9
npx https://pkg.pr.new/@moonshot-ai/kimi-code@27e5ec9

commit: 27e5ec9

@liruifengv liruifengv merged commit fd16ffb into main Jun 23, 2026
8 checks passed
@liruifengv liruifengv deleted the disable-tab-file branch June 23, 2026 08:51
@github-actions github-actions Bot mentioned this pull request Jun 23, 2026
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