@@ -189,24 +189,24 @@ export class ExecuteBash {
189189 if ( cmdArgs . length === 0 ) {
190190 return { requiresAcceptance : true }
191191 }
192-
192+ let hasOutsideWorkspacePath = false
193193 // For each command, validate arguments for path safety within workspace
194194 for ( const arg of cmdArgs ) {
195195 if ( this . looksLikePath ( arg ) ) {
196- // If not absolute, resolve using workingDirectory if available.
197196 let fullPath = arg
198197 if ( ! path . isAbsolute ( arg ) && this . workingDirectory ) {
199198 fullPath = path . join ( this . workingDirectory , arg )
200199 }
201200 const workspaceFolders = vscode . workspace . workspaceFolders
202201 if ( ! workspaceFolders || workspaceFolders . length === 0 ) {
203- return { requiresAcceptance : true }
202+ hasOutsideWorkspacePath = true
203+ continue
204204 }
205205 const isInWorkspace = workspaceFolders . some ( ( folder ) =>
206206 isInDirectory ( folder . uri . fsPath , fullPath )
207207 )
208208 if ( ! isInWorkspace ) {
209- return { requiresAcceptance : true }
209+ hasOutsideWorkspacePath = true
210210 }
211211 }
212212 }
@@ -220,6 +220,9 @@ export class ExecuteBash {
220220 case CommandCategory . Mutate :
221221 return { requiresAcceptance : true , warning : mutateCommandWarningMessage }
222222 case CommandCategory . ReadOnly :
223+ if ( hasOutsideWorkspacePath ) {
224+ return { requiresAcceptance : true }
225+ }
223226 continue
224227 default :
225228 return { requiresAcceptance : true }
0 commit comments