mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-08 10:21:11 +00:00
fix(completion): fail closed on backend errors
- silence unexpected completion backend exceptions so TAB completion does not emit stack traces
This commit is contained in:
@@ -254,7 +254,11 @@ function formatForShell(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function handleCompletionCommand(args: string[]): Promise<void> {
|
export async function handleCompletionCommand(args: string[]): Promise<void> {
|
||||||
const request = parseCompletionArgs(args);
|
try {
|
||||||
const suggestions = getCompletionSuggestions(request);
|
const request = parseCompletionArgs(args);
|
||||||
process.stdout.write(formatForShell(request.shell, suggestions).join('\n'));
|
const suggestions = getCompletionSuggestions(request);
|
||||||
|
process.stdout.write(formatForShell(request.shell, suggestions).join('\n'));
|
||||||
|
} catch {
|
||||||
|
// Completion must fail closed and quietly so shell TAB does not surface stack traces.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user