fix(claude): disable unavailable Windows sandbox
This commit is contained in:
1 parent
49be8edbec
commit
cacb41fe28
6 files changed
+12
-10
No files matched your search
@@ -194,9 +194,10 @@ foreach ($shell in @('powershell','bash')) {
|
||||
$script = if ($shell -eq 'powershell') { 'flashbang.ps1' } else { 'flashbang.sh' }
|
||||
$statusLineScript = if ($shell -eq 'powershell') { 'statusline.ps1' } else { 'statusline.sh' }
|
||||
$content = Get-Content -LiteralPath $path -Raw
|
||||
$sandbox = if ($shell -eq 'powershell') { '{"enabled": false}' } else { '{"enabled": true, "allowUnsandboxedCommands": false, "failIfUnavailable": true}' }
|
||||
$compactScript = if ($shell -eq 'powershell') { 'Record-Compact.ps1' } else { 'record-compact.sh' }
|
||||
$pointerScript = if ($shell -eq 'powershell') { 'Show-SessionStatePointer.ps1' } else { 'show-session-state-pointer.sh' }
|
||||
$content = $content.Replace('__HOOK_COMMAND__', $command).Replace('__POWERSHELL_HOOK_COMMAND__', $command).Replace('__HOOK_SCRIPT__', $script).Replace('__POWERSHELL_HOOK_SCRIPT__', $script).Replace('__COMPACT_SCRIPT__', $compactScript).Replace('__SESSION_POINTER_SCRIPT__', $pointerScript).Replace('__STATUSLINE_COMMAND__', $command).Replace('__STATUSLINE_SCRIPT__', $statusLineScript)
|
||||
$content = $content.Replace('__HOOK_COMMAND__', $command).Replace('__POWERSHELL_HOOK_COMMAND__', $command).Replace('__HOOK_SCRIPT__', $script).Replace('__POWERSHELL_HOOK_SCRIPT__', $script).Replace('__COMPACT_SCRIPT__', $compactScript).Replace('__SESSION_POINTER_SCRIPT__', $pointerScript).Replace('__STATUSLINE_COMMAND__', $command).Replace('__STATUSLINE_SCRIPT__', $statusLineScript).Replace('__CLAUDE_SANDBOX__', $sandbox)
|
||||
Set-Content -LiteralPath $path -Value $content -Encoding UTF8
|
||||
}
|
||||
|
||||
|
||||
@@ -200,6 +200,8 @@ for client in codex claude; do
|
||||
fi
|
||||
path="$output/$client-$shell/$file"
|
||||
content=$(<"$path")
|
||||
sandbox='{"enabled": true, "allowUnsandboxedCommands": false, "failIfUnavailable": true}'
|
||||
[ "$shell" != powershell ] || sandbox='{"enabled": false}'
|
||||
content=${content//__HOOK_COMMAND__/$command}
|
||||
content=${content//__POWERSHELL_HOOK_COMMAND__/$command}
|
||||
content=${content//__HOOK_SCRIPT__/$script}
|
||||
@@ -208,6 +210,7 @@ for client in codex claude; do
|
||||
content=${content//__SESSION_POINTER_SCRIPT__/$pointer_script}
|
||||
content=${content//__STATUSLINE_COMMAND__/$command}
|
||||
content=${content//__STATUSLINE_SCRIPT__/$statusline_script}
|
||||
content=${content//__CLAUDE_SANDBOX__/$sandbox}
|
||||
printf '%s\n' "$content" > "$path"
|
||||
done
|
||||
|
||||
|
||||
Reference in new issue
Block a user