From 3bd58780a3a936a68a43b6d3c467baed26897766 Mon Sep 17 00:00:00 2001 From: andrepimenta Date: Fri, 20 Jun 2025 19:31:50 +0100 Subject: [PATCH] Sending sessions --- src/extension.ts | 18 ++++++++++++++++-- src/ui-styles.ts | 16 ++++++++++++++++ src/ui.ts | 3 +++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index ac54cb4..64e08c1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1242,12 +1242,20 @@ class ClaudeChatProvider { const wslDistro = config.get('wsl.distro', 'Ubuntu'); const claudePath = config.get('wsl.claudePath', '/usr/local/bin/claude'); + // Build command arguments + const args = ['/model']; + + // Add session resume if we have a current session + if (this._currentSessionId) { + args.push('--resume', this._currentSessionId); + } + // Create terminal with the claude /model command const terminal = vscode.window.createTerminal('Claude Model Selection'); if (wslEnabled) { - terminal.sendText(`wsl -d ${wslDistro} ${claudePath} /model`); + terminal.sendText(`wsl -d ${wslDistro} ${claudePath} ${args.join(' ')}`); } else { - terminal.sendText('claude /model'); + terminal.sendText(`claude ${args.join(' ')}`); } terminal.show(); @@ -1292,6 +1300,12 @@ class ClaudeChatProvider { `Executing /${command} command in terminal. Check the terminal output and return when ready.`, 'OK' ); + + // Send message to UI about terminal + this._panel?.webview.postMessage({ + type: 'terminalOpened', + data: `Executing /${command} command in terminal. Check the terminal output and return when ready.`, + }); } public dispose() { diff --git a/src/ui-styles.ts b/src/ui-styles.ts index 163eeb8..aa3b8f5 100644 --- a/src/ui-styles.ts +++ b/src/ui-styles.ts @@ -1052,6 +1052,22 @@ const styles = ` } /* Slash commands modal */ + .slash-commands-info { + padding: 12px 16px; + background-color: rgba(255, 149, 0, 0.1); + border: 1px solid rgba(255, 149, 0, 0.2); + border-radius: 4px; + margin-bottom: 16px; + } + + .slash-commands-info p { + margin: 0; + font-size: 11px; + color: var(--vscode-descriptionForeground); + text-align: center; + opacity: 0.9; + } + .slash-commands-list { display: grid; gap: 8px; diff --git a/src/ui.ts b/src/ui.ts index 224d630..d97cd54 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -321,6 +321,9 @@ const html = ` Claude Code Commands +
+

These commands require the Claude CLI and will open in VS Code terminal. Return here after completion.

+
🐛