Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ import { renderStringAsPlaintext } from '../../../../../base/browser/markdownRen
type VoiceChatSessionContext = 'view' | 'inline' | 'terminal' | 'quick' | 'editor';
const VoiceChatSessionContexts: VoiceChatSessionContext[] = ['view', 'inline', 'terminal', 'quick', 'editor'];

const TerminalChatExecute = MenuId.for('terminalChatInput'); // unfortunately, terminal decided to go with their own menu (https://github.com/microsoft/vscode/issues/208789)

// Global Context Keys (set on global context key service)
const CanVoiceChat = ContextKeyExpr.and(CONTEXT_CHAT_ENABLED, HasSpeechProvider);
const FocusInChatInput = ContextKeyExpr.or(CTX_INLINE_CHAT_FOCUSED, CONTEXT_IN_CHAT_INPUT);
Expand Down Expand Up @@ -609,6 +611,16 @@ export class StartVoiceChatAction extends Action2 {
group: 'navigation',
order: 2
},
{
id: TerminalChatExecute,
when: ContextKeyExpr.and(
HasSpeechProvider,
ScopedChatSynthesisInProgress.negate(), // hide when text to speech is in progress
AnyScopedVoiceChatInProgress?.negate(), // hide when voice chat is in progress
),
group: 'navigation',
order: -1
},
]
});
}
Expand Down Expand Up @@ -656,6 +668,12 @@ export class StopListeningAction extends Action2 {
when: ContextKeyExpr.and(CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Panel).negate(), AnyScopedVoiceChatInProgress),
group: 'navigation',
order: 2
}, {

id: TerminalChatExecute,
when: AnyScopedVoiceChatInProgress,
group: 'navigation',
order: -1
},
]
});
Expand Down Expand Up @@ -991,6 +1009,12 @@ export class StopReadAloud extends Action2 {
group: 'navigation',
order: 2
},
{
id: TerminalChatExecute,
when: ScopedChatSynthesisInProgress,
group: 'navigation',
order: -1
}
]
});
}
Expand Down Expand Up @@ -1325,9 +1349,14 @@ export class InstallSpeechProviderForVoiceChatAction extends BaseInstallSpeechPr
precondition: InstallingSpeechProvider.negate(),
menu: [{
id: MenuId.ChatInput,
when: HasSpeechProvider.negate(),
when: ContextKeyExpr.and(HasSpeechProvider.negate(), CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Terminal).negate()),
group: 'navigation',
order: 3
}, {
id: TerminalChatExecute,
when: HasSpeechProvider.negate(),
group: 'navigation',
order: -1
}]
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export class TerminalChatController extends Disposable implements ITerminalContr
await this.reveal();
}
assertType(this._model.value);
this._messages.fire(Message.ACCEPT_INPUT);
const lastInput = this._terminalChatWidget.value.inlineChatWidget.value;
if (!lastInput) {
return;
Expand Down