[ZSH] No blocking safe-wrapper prompts in agent shells
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
61ff4a8daa
commit
afd4b439c2
1 file changed
+8
-3
+8
-3
@@ -51,9 +51,14 @@ source "${ZDOTDIR:-$HOME}/.zsh/lib/interactive.zsh"
|
||||
|
||||
export LIBVIRT_DEFAULT_URI="qemu:///system"
|
||||
if (( ! shared_config )); then
|
||||
(( $+commands[safecp] )) && alias cp=safecp
|
||||
(( $+commands[safemv] )) && alias mv=safemv
|
||||
(( $+commands[safescp] )) && alias scp=safescp
|
||||
# Agent shells: </dev/null makes the prompt decline (exit 1) instead of blocking.
|
||||
if [[ -n ${CLAUDECODE:-} || -n ${CODEX_SHELL:-} ]]; then
|
||||
_safe_redir=' </dev/null'
|
||||
fi
|
||||
(( $+commands[safecp] )) && alias cp="safecp${_safe_redir:-}"
|
||||
(( $+commands[safemv] )) && alias mv="safemv${_safe_redir:-}"
|
||||
(( $+commands[safescp] )) && alias scp="safescp${_safe_redir:-}"
|
||||
unset _safe_redir
|
||||
fi
|
||||
|
||||
[[ -f ~/.zsh/.mac_config ]] && source ~/.zsh/.mac_config
|
||||
|
||||
Reference in new issue
Block a user