mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
prevent crash on empty shell cmd with $ or ! (#240)
This commit is contained in:
@@ -41,7 +41,12 @@ export const useShellCommandProcessor = (
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Remove symbol from rawQuery
|
// 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
|
// Add user message *before* execution starts
|
||||||
const userMessageTimestamp = Date.now();
|
const userMessageTimestamp = Date.now();
|
||||||
|
|||||||
Reference in New Issue
Block a user