mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-08 17:39:44 +00:00
Run /compact command in chat instead of spawning terminal
The /compact command now executes through the chat interface using the existing Claude process, providing a seamless user experience instead of opening a separate terminal window. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2637,6 +2637,12 @@ class ClaudeChatProvider {
|
||||
}
|
||||
|
||||
private _executeSlashCommand(command: string): void {
|
||||
// Handle /compact in chat instead of spawning a terminal
|
||||
if (command === 'compact') {
|
||||
this._sendMessageToClaude(`/${command}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const config = vscode.workspace.getConfiguration('claudeCodeChat');
|
||||
const wslEnabled = config.get<boolean>('wsl.enabled', false);
|
||||
const wslDistro = config.get<string>('wsl.distro', 'Ubuntu');
|
||||
|
||||
@@ -1679,18 +1679,22 @@ const getScript = (isTelemetryEnabled: boolean) => `<script>
|
||||
function executeSlashCommand(command) {
|
||||
// Hide the modal
|
||||
hideSlashCommandsModal();
|
||||
|
||||
|
||||
// Clear the input since user selected a command
|
||||
messageInput.value = '';
|
||||
|
||||
// Send command to VS Code to execute in terminal
|
||||
|
||||
// Send command to VS Code to execute
|
||||
vscode.postMessage({
|
||||
type: 'executeSlashCommand',
|
||||
command: command
|
||||
});
|
||||
|
||||
// Show user feedback
|
||||
addMessage('user', \`Executing /\${command} command in terminal. Check the terminal output and return when ready.\`, 'assistant');
|
||||
|
||||
// Show user feedback - /compact runs in chat, others in terminal
|
||||
if (command === 'compact') {
|
||||
// No message needed - compact runs in chat and shows its own status
|
||||
} else {
|
||||
addMessage('user', \`Executing /\${command} command in terminal. Check the terminal output and return when ready.\`, 'assistant');
|
||||
}
|
||||
}
|
||||
|
||||
function handleCustomCommandKeydown(event) {
|
||||
|
||||
Reference in New Issue
Block a user