mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-08 19:29:43 +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 {
|
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 config = vscode.workspace.getConfiguration('claudeCodeChat');
|
||||||
const wslEnabled = config.get<boolean>('wsl.enabled', false);
|
const wslEnabled = config.get<boolean>('wsl.enabled', false);
|
||||||
const wslDistro = config.get<string>('wsl.distro', 'Ubuntu');
|
const wslDistro = config.get<string>('wsl.distro', 'Ubuntu');
|
||||||
|
|||||||
@@ -1679,18 +1679,22 @@ const getScript = (isTelemetryEnabled: boolean) => `<script>
|
|||||||
function executeSlashCommand(command) {
|
function executeSlashCommand(command) {
|
||||||
// Hide the modal
|
// Hide the modal
|
||||||
hideSlashCommandsModal();
|
hideSlashCommandsModal();
|
||||||
|
|
||||||
// Clear the input since user selected a command
|
// Clear the input since user selected a command
|
||||||
messageInput.value = '';
|
messageInput.value = '';
|
||||||
|
|
||||||
// Send command to VS Code to execute in terminal
|
// Send command to VS Code to execute
|
||||||
vscode.postMessage({
|
vscode.postMessage({
|
||||||
type: 'executeSlashCommand',
|
type: 'executeSlashCommand',
|
||||||
command: command
|
command: command
|
||||||
});
|
});
|
||||||
|
|
||||||
// Show user feedback
|
// Show user feedback - /compact runs in chat, others in terminal
|
||||||
addMessage('user', \`Executing /\${command} command in terminal. Check the terminal output and return when ready.\`, 'assistant');
|
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) {
|
function handleCustomCommandKeydown(event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user