Skip to content

Commit 264017d

Browse files
committed
fix: Prevent terminal focus theft on paste after command execution
Resolves #3199 This commit addresses an issue where pasting text into the chat input field would sometimes result in the text being pasted into the VS Code terminal instead. The root cause was identified as the `terminal.show()` method being called without the `preserveFocus` option when the Roo agent executed a command. This default behavior caused the terminal to gain keyboard focus. The fix involves modifying the call in `src/core/tools/executeCommandTool.ts` to `terminal.terminal.show(true)`. This ensures that while the terminal is made visible, keyboard focus remains on the previously active element (e.g., the chat input), preventing the misdirection of paste actions.
1 parent 0725b32 commit 264017d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/tools/executeCommandTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export async function executeCommand(
195195
const terminal = await TerminalRegistry.getOrCreateTerminal(workingDir, !!customCwd, cline.taskId, terminalProvider)
196196

197197
if (terminal instanceof Terminal) {
198-
terminal.terminal.show()
198+
terminal.terminal.show(true)
199199

200200
// Update the working directory in case the terminal we asked for has
201201
// a different working directory so that the model will know where the

0 commit comments

Comments
 (0)