[ZSH] No safe wrappers in CODEX/CODE shells

This commit is contained in:
Fabian Ising committed 2026-10-01 10:42:54 +02:00
1 parent 874a823d1e
commit b0853dc5dd
1 file changed
+8 -3
+8 -3
View File
@@ -28,9 +28,14 @@ if (( $+commands[go] )); then
fi fi
# Use safe wrappers after ~/.local/bin has been added to PATH. # Use safe wrappers after ~/.local/bin has been added to PATH.
(( $+commands[safecp] )) && alias cp=safecp # Agent shells: </dev/null makes the prompt decline (exit 1) instead of blocking.
(( $+commands[safemv] )) && alias mv=safemv if [[ -n ${CLAUDECODE:-} || -n ${CODEX_SHELL:-} ]]; then
(( $+commands[safescp] )) && alias scp=safescp _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
if [[ -f ~/.ssh/sudo_key ]]; then if [[ -f ~/.ssh/sudo_key ]]; then
[[ -e /tmp/sudo-agent.sock ]] || ssh-agent -a /tmp/sudo-agent.sock &>/dev/null [[ -e /tmp/sudo-agent.sock ]] || ssh-agent -a /tmp/sudo-agent.sock &>/dev/null