Fix /clear from suggest widget (#188959)

* Fix `/clear` from suggest widget
This commit is contained in:
Joyce Er 2023-07-26 11:35:06 -07:00 committed by GitHub
parent 5b4a3822f0
commit e7a70b7d00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -434,7 +434,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
const editorValue = this.inputPart.inputEditor.getValue();
// Shortcut for /clear command
if (!query && editorValue.trim() === '/clear') {
if (!query && editorValue.trim() === '/clear' || typeof query === 'string' && query.trim() === '/clear') {
// Small hack, if this becomes a repeated pattern, we should have a real internal slash command provider system
this.instantiationService.invokeFunction(clearChatSession, this);
return;