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 #208413
This commit is contained in:
Daniel Imms 2024-03-22 13:55:47 -07:00
parent fb757ca041
commit abc27efc71
No known key found for this signature in database
GPG key ID: E5CF412B63651C69

View file

@ -115,11 +115,7 @@ export class TerminalChatController extends Disposable implements ITerminalContr
}
this._register(this._chatCodeBlockContextProviderService.registerProvider({
getCodeBlockContext: (editor) => {
const chatWidget = this.chatWidget;
if (!chatWidget) {
return;
}
if (!editor) {
if (!editor || !this._chatWidget?.hasValue || !this.hasFocus()) {
return;
}
return {