Sending sessions

This commit is contained in:
andrepimenta
2025-06-20 19:31:50 +01:00
parent b4b86d1e7f
commit 3bd58780a3
3 changed files with 35 additions and 2 deletions

View File

@@ -1242,12 +1242,20 @@ class ClaudeChatProvider {
const wslDistro = config.get<string>('wsl.distro', 'Ubuntu');
const claudePath = config.get<string>('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() {

View File

@@ -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;

View File

@@ -321,6 +321,9 @@ const html = `<!DOCTYPE html>
<span>Claude Code Commands</span>
<button class="tools-close-btn" onclick="hideSlashCommandsModal()">✕</button>
</div>
<div class="slash-commands-info">
<p>These commands require the Claude CLI and will open in VS Code terminal. Return here after completion.</p>
</div>
<div class="slash-commands-list">
<div class="slash-command-item" onclick="executeSlashCommand('bug')">
<div class="slash-command-icon">🐛</div>