Skip to content

fix(tui): enable file path completion for / in shell mode - #1225

Merged
liruifengv merged 3 commits into
mainfrom
fix/shell-mode-slash-completion
Jun 30, 2026
Merged

fix(tui): enable file path completion for / in shell mode#1225
liruifengv merged 3 commits into
mainfrom
fix/shell-mode-slash-completion

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

No related issue.

Problem

In shell mode (!), typing / opened the slash command menu instead of file path completion, so paths inside a shell command could not be autocompleted. Typing ls / produced no completion, and accepting a completion for a bare leading / produced a double slash (//Applications/) with a trailing space that blocked further completion.

What changed

  • Typing / in shell mode now triggers file path completion, for both a bare leading / and inline paths such as ls /.
  • Dot-prefixed hidden entries are filtered out, matching the /add-dir directory completer.
  • Accepting a path completion replaces the prefix verbatim, so a bare / no longer turns into //... and the next path level keeps completing.

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.

@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f588a29

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

Typing `/\' in shell mode (`!\') now triggers file path completion instead of the slash command menu, for both a bare leading `/\' and inline paths like `ls /\'. Hidden entries are skipped to match `/add-dir\', and accepting a completion no longer produces a double leading slash.
@liruifengv
liruifengv force-pushed the fix/shell-mode-slash-completion branch from 814827e to 72583b2 Compare June 30, 2026 08:26
@pkg-pr-new

pkg-pr-new Bot commented Jun 30, 2026

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

commit: f588a29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 814827e496

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/components/editor/file-mention-provider.ts
@liruifengv
liruifengv force-pushed the fix/shell-mode-slash-completion branch 3 times, most recently from 7eb69e8 to a70a3da Compare June 30, 2026 08:51
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a70a3da9f7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/components/editor/file-mention-provider.ts Outdated
Typing `/\' in shell mode (`!\') now triggers file path completion instead of the slash command menu, for both a bare leading `/\' and inline paths like `ls /\'. Hidden entries are skipped to match `/add-dir\', accepting a completion no longer doubles the leading slash, paths that start with a slash command name complete inside the path, slash argument hints and token highlighting are suppressed, a trailing space after a slash-shaped command no longer falls back to subcommand completion, and completing a quoted directory keeps the cursor inside the closing quote.
@liruifengv
liruifengv force-pushed the fix/shell-mode-slash-completion branch from a70a3da to 44872a5 Compare June 30, 2026 09:08
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44872a5413

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/components/editor/custom-editor.ts
@liruifengv
liruifengv merged commit 659062d into main Jun 30, 2026
9 checks passed
@liruifengv
liruifengv deleted the fix/shell-mode-slash-completion branch June 30, 2026 09:54
@github-actions github-actions Bot mentioned this pull request Jun 30, 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