prevent crash on empty shell cmd with $ or ! (#240)

This commit is contained in:
Olcan
2025-05-01 13:41:00 -07:00
committed by GitHub
parent a386841947
commit ca53565240

View File

@@ -41,7 +41,12 @@ export const useShellCommandProcessor = (
return false;
}
// Remove symbol from rawQuery
const trimmed = rawQuery.trim().slice(1);
const trimmed = rawQuery.trim().slice(1).trimStart();
// Stop if command is empty
if (!trimmed) {
return false;
}
// Add user message *before* execution starts
const userMessageTimestamp = Date.now();