mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
slash command altnames and support for ?
This commit is contained in:
@@ -119,9 +119,18 @@ export function useCompletion(
|
||||
// --- Handle Slash Command Completion ---
|
||||
if (trimmedQuery.startsWith('/')) {
|
||||
const partialCommand = trimmedQuery.substring(1);
|
||||
const filteredSuggestions = slashCommands
|
||||
const commands = slashCommands
|
||||
.map((cmd) => cmd.name)
|
||||
.concat(
|
||||
slashCommands
|
||||
.map((cmd) => cmd.altName)
|
||||
.filter((cmd) => cmd !== undefined),
|
||||
);
|
||||
|
||||
const filteredSuggestions = commands
|
||||
.filter((name) => name.startsWith(partialCommand))
|
||||
// Filter out ? and any other single character commands
|
||||
.filter((name) => name.length > 1)
|
||||
.map((name) => ({ label: name, value: name }))
|
||||
.sort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user