Skip to content

Commit 43c1c85

Browse files
committed
Fix permissions and add windows support
1 parent b07857b commit 43c1c85

File tree

5 files changed

+13
-22
lines changed

5 files changed

+13
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Ditch the command line and experience Claude Code like never before. This extens
2222
🧠 **Plan and Thinking modes** - Plan First and configurable Thinking modes for better results
2323
**Smart File/Image Context and Custom Commands** - Reference any file, copy images or screenshots, and create custom commands
2424
🤖 **Model Selection** - Choose between Opus, Sonnet, or Default based on your needs
25-
🐧 **WSL Support** - Full Windows Subsystem for Linux integration and compatibility
25+
🐧 **Windows/WSL Support** - Full Windows support and Windows Subsystem for Linux integration and compatibility
2626

2727
![Claude Code Chat 1 0 0](https://github.com/user-attachments/assets/5954a74c-eff7-4205-8482-6a1c9de6e102)
2828

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "claude-code-chat",
33
"displayName": "Claude Code Chat",
44
"description": "Beautiful Claude Code Chat Interface for VS Code",
5-
"version": "1.0.0",
5+
"version": "1.0.3",
66
"publisher": "AndrePimenta",
77
"author": "Andre Pimenta",
88
"repository": {

src/extension.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ class ClaudeChatProvider {
122122
this._initializeBackupRepo();
123123
this._initializeConversations();
124124
this._initializeMCPConfig();
125-
this._initializePermissions();
126125

127126
// Load conversation index from workspace state
128127
this._conversationIndex = this._context.workspaceState.get('claude.conversationIndex', []);
@@ -166,6 +165,7 @@ class ClaudeChatProvider {
166165
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
167166

168167
this._setupWebviewMessageHandler(this._panel.webview);
168+
this._initializePermissions();
169169

170170
// Resume session from latest conversation
171171
const latestConversation = this._getLatestConversation();
@@ -345,6 +345,7 @@ class ClaudeChatProvider {
345345
this._webview.html = this._getHtmlForWebview();
346346

347347
this._setupWebviewMessageHandler(this._webview);
348+
this._initializePermissions();
348349

349350
// Initialize the webview
350351
this._initializeWebview();
@@ -437,9 +438,6 @@ class ClaudeChatProvider {
437438
data: 'Claude is working...'
438439
});
439440

440-
// Call claude with the message via stdin using stream-json format
441-
console.log('Calling Claude with message via stdin:', message);
442-
443441
// Build command arguments with session management
444442
const args = [
445443
'-p',
@@ -466,7 +464,6 @@ class ClaudeChatProvider {
466464
// Add model selection if not using default
467465
if (this._selectedModel && this._selectedModel !== 'default') {
468466
args.push('--model', this._selectedModel);
469-
console.log('Using model:', this._selectedModel);
470467
}
471468

472469
// Add session resume if we have a current session
@@ -490,8 +487,6 @@ class ClaudeChatProvider {
490487
console.log('Using WSL configuration:', { wslDistro, nodePath, claudePath });
491488
const wslCommand = `"${nodePath}" --no-warnings --enable-source-maps "${claudePath}" ${args.join(' ')}`;
492489

493-
console.log('wsl', ['-d', wslDistro, 'bash', '-ic', wslCommand].join(" "))
494-
495490
claudeProcess = cp.spawn('wsl', ['-d', wslDistro, 'bash', '-ic', wslCommand], {
496491
cwd: cwd,
497492
stdio: ['pipe', 'pipe', 'pipe'],
@@ -505,6 +500,7 @@ class ClaudeChatProvider {
505500
// Use native claude command
506501
console.log('Using native Claude command');
507502
claudeProcess = cp.spawn('claude', args, {
503+
shell: process.platform === 'win32',
508504
cwd: cwd,
509505
stdio: ['pipe', 'pipe', 'pipe'],
510506
env: {
@@ -601,8 +597,6 @@ class ClaudeChatProvider {
601597
}
602598

603599
private _processJsonStreamData(jsonData: any) {
604-
console.log('Received JSON data:', jsonData);
605-
606600
switch (jsonData.type) {
607601
case 'system':
608602
if (jsonData.subtype === 'init') {
@@ -1102,6 +1096,12 @@ class ClaudeChatProvider {
11021096

11031097
private async _initializePermissions(): Promise<void> {
11041098
try {
1099+
1100+
if(this._permissionWatcher){
1101+
this._permissionWatcher.dispose();
1102+
this._permissionWatcher = undefined;
1103+
}
1104+
11051105
const storagePath = this._context.storageUri?.fsPath;
11061106
if (!storagePath) {return;}
11071107

src/ui-styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ const styles = `
8686
/* Permission Request */
8787
.permission-request {
8888
margin: 4px 12px 20px 12px;
89-
background-color: var(--vscode-inputValidation-warningBackground);
90-
border: 1px solid var(--vscode-inputValidation-warningBorder);
89+
background-color: rgba(252, 188, 0, 0.1);
90+
border: 1px solid rgba(252, 188, 0, 0.3);
9191
border-radius: 8px;
9292
padding: 16px;
9393
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

src/ui.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,6 @@ const html = `<!DOCTYPE html>
26192619
break;
26202620
26212621
case 'updateTokens':
2622-
console.log('Tokens updated in real-time:', message.data);
26232622
// Update token totals in real-time
26242623
totalTokensInput = message.data.totalTokensInput || 0;
26252624
totalTokensOutput = message.data.totalTokensOutput || 0;
@@ -2644,12 +2643,6 @@ const html = `<!DOCTYPE html>
26442643
break;
26452644
26462645
case 'updateTotals':
2647-
console.log('Totals updated:', message.data);
2648-
console.log('Cost data received:', {
2649-
totalCost: message.data.totalCost,
2650-
currentCost: message.data.currentCost,
2651-
previousTotalCost: totalCost
2652-
});
26532646
// Update local tracking variables
26542647
totalCost = message.data.totalCost || 0;
26552648
totalTokensInput = message.data.totalTokensInput || 0;
@@ -2693,7 +2686,6 @@ const html = `<!DOCTYPE html>
26932686
break;
26942687
26952688
case 'showRestoreOption':
2696-
console.log('Show restore option:', message.data);
26972689
showRestoreContainer(message.data);
26982690
break;
26992691
@@ -3135,7 +3127,6 @@ const html = `<!DOCTYPE html>
31353127
}
31363128
31373129
function loadConversation(filename) {
3138-
console.log('Loading conversation:', filename);
31393130
vscode.postMessage({
31403131
type: 'loadConversation',
31413132
filename: filename

0 commit comments

Comments
 (0)