@ file suggestions don't shown when using /commands
What happened?
When using custom commands like /plan none of the @ suggestions are appearing
Steps to Reproduce
- Type
@in the Gemini CLI prompt. A list of available files should appear for autocompletion. - Select a file.
- After the file path, type
/. - Result: No command autocompletion suggestions appear.
OR
- Type
/in the Gemini CLI prompt. A list of commands should appear for autocompletion. - Select a command.
- After the command, type
@. - Result: No file path autocompletion suggestions appear.
What did you expect to happen?
For suggestions to appear using commands
Client information
╭─────────────────────────────────────────────────────────────╮
│ │
│ About Gemini CLI │
│ │
│ CLI Version 0.1.22 │
│ Git Commit 5fe4e023 │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS darwin │
│ Auth Method gemini-api-key │
│ │
╰─────────────────────────────────────────────────────────────╯
Login information
No response
Anything else we need to know?
No response
This is intentional. Commands do not necessarily take file path inputs and it would be misleading to imply that they do. Commands that do take file path inputs can support autocomplete if they want to, tho.
If there is a specific command that takes a file path input and doesn't autocomplete, open a issue to request that.
@scidomino we support custom commands like /plan, how else are users supposed to add file contexts in these situations? cc @jacob314
Agree this is important. @abhipatel12 is working on it.
@jacob314 i have a ready and simple fix for this...
I implemented dual-mode completion for custom commands by modifying useCommandCompletion.tsx to check if a slash command is a custom command (using CommandKind.FILE). For built-in commands, we immediately return SLASH mode (preserving existing behavior). For custom commands, we allow the logic to continue and check for @ symbols, enabling both slash command completion AND file path completion in the same input.
But it will work only if #6776 is accepted because I have wrapping at 20 chars.
The wrapping occurs because SuggestionsDisplay uses userInput.startsWith('/') to decide rendering style. When the input starts with /, it applies a 20-character width limit designed for command names.
- Simple
@pathsuggestions: Input is just@filename, doesn't start with/, so no width constraint is applied - Our custom command case: Input is
/custom @filename, starts with/, so the 20-character limit is incorrectly applied even though we're now showing file suggestions
Kind regards Davor
Update: Hardcoded width fixed #5797
Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.
It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.
Thank you for your contribution!
Hi @miguelsolorio @jacob314 !
Can you reopen this? I belive it is quite important.
Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.
It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.
Thank you for your contribution!
Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.
It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.
Thank you for your contribution!