-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
� Bug: Terminal Silently Drops Consecutive Duplicate Commands
Description
When using the debug control buttons (e.g., clicking "Next" or "Step" twice in a row), the second click is completely ignored by the terminal and backend.
Root Cause
In TerminalComp.jsx, the useEffect that triggers commands relies on toggling commandPress to run:
useEffect(() => {
if (terminalOutput) {
defaultHandler(terminalOutput);
}
}, [commandPress]); However:
- If the same command is sent consecutively,
terminalOutputremains the same. commandPresstoggles back to its previous boolean state.- React bails out of the effect because the dependencies haven't changed in a way that triggers a re-render/effect execution.
terminalOutputis missing from the dependency array, violating React hooks exhaustive-deps rules.
Expected behaviour
Clicking "Next" three times should execute the next GDB command three times.
To Reproduce
- Start a debugging session.
- Click the "Next" (arrow right) button in the
DebugHeader. - The terminal executes
next. - Click the same "Next" button again.
- Bug: Nothing happens. The command is dropped.
Suggested Fix
Refactor the global state to use an event emitter or replace the boolean toggle with an incrementing counter (e.g., setCommandCount(prev => prev + 1)) so the dependency array always sees a new value on every button click.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels