@@ -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
0 commit comments