mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
fix: kill child process when statusLine config is removed
When statusLineCommand becomes undefined (user removes the setting), kill any in-flight child process, bump generation counter, and clear the debounce timer so stale callbacks cannot resurrect the output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1a985bb02e
commit
4c4e63888a
1 changed files with 9 additions and 2 deletions
|
|
@ -204,6 +204,14 @@ export function useStatusLine(): {
|
|||
// Trigger update when meaningful state changes
|
||||
useEffect(() => {
|
||||
if (!statusLineCommand) {
|
||||
// Command removed — kill any in-flight process and discard callbacks.
|
||||
activeChildRef.current?.kill();
|
||||
activeChildRef.current = undefined;
|
||||
generationRef.current++;
|
||||
if (debounceTimerRef.current !== undefined) {
|
||||
clearTimeout(debounceTimerRef.current);
|
||||
debounceTimerRef.current = undefined;
|
||||
}
|
||||
setOutput(null);
|
||||
return;
|
||||
}
|
||||
|
|
@ -233,9 +241,8 @@ export function useStatusLine(): {
|
|||
if (!hasMountedRef.current) return;
|
||||
if (statusLineCommand) {
|
||||
doUpdate();
|
||||
} else {
|
||||
setOutput(null);
|
||||
}
|
||||
// Cleanup when command is removed is handled by the state-change effect.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [statusLineCommand]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue