mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-17 15:23:08 -07:00
fix(cli): prioritize shorter command names in shell autocomplete results
This commit is contained in:
@@ -483,6 +483,13 @@ export function useShellCompletion({
|
||||
const queryLower = query.toLowerCase();
|
||||
results = pathCacheRef.current
|
||||
.filter((cmd) => cmd.toLowerCase().startsWith(queryLower))
|
||||
.sort((a, b) => {
|
||||
// Prioritize shorter commands as they are likely common built-ins
|
||||
if (a.length !== b.length) {
|
||||
return a.length - b.length;
|
||||
}
|
||||
return a.localeCompare(b);
|
||||
})
|
||||
.slice(0, MAX_SHELL_SUGGESTIONS)
|
||||
.map((cmd) => ({
|
||||
label: cmd,
|
||||
|
||||
Reference in New Issue
Block a user