Skip to content

Commit abc27ef

Browse files
committed
Fix copy action being stolen by terminal chat
What was happening here is chatWidget was called which would initialize the terminal chat widget, so I switched that to check whether the lazy value exists and added a hasFocus check for good measure. Fixes microsoft#208413
1 parent fb757ca commit abc27ef

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ export class TerminalChatController extends Disposable implements ITerminalContr
115115
}
116116
this._register(this._chatCodeBlockContextProviderService.registerProvider({
117117
getCodeBlockContext: (editor) => {
118-
const chatWidget = this.chatWidget;
119-
if (!chatWidget) {
120-
return;
121-
}
122-
if (!editor) {
118+
if (!editor || !this._chatWidget?.hasValue || !this.hasFocus()) {
123119
return;
124120
}
125121
return {

0 commit comments

Comments
 (0)