.agents/skills/project-knowledge/references/bash.md
Verified on bash 5.2 (2026-07).
exec builtin from PROMPT_COMMAND - even a harmless exec {fd}</dev/null -
silently disables readline for the whole session: the prompt never paints again, no error,
commands still execute non-interactively. Use coproc fds directly; never exec-dup or exec-close
from prompt context.'$(_omp_get_primary)' (single-quoted). With promptvars on, literal prompt
content executes $(...) - a directory named $(cmd) becomes command injection.script -qe -c ... FILE) when verifying prompt behavior. Note script(1)'s stdout relay does
not carry bash prompt bytes (zsh's does); probe ${PS1@P} in-session instead.coproc NAME { cmd; } reports the pid of a wrapper subshell - exec in the body so the daemon
replaces it.eval "exec ${NAME[0]}<&- ${NAME[1]}>&-") or the child's stdin never EOFs when the dups close.(trap '' PIPE; ...) subshell guard does
not work there; save/ignore/restore trap '' PIPE in the parent instead (nothing forks while
ignored).>&fd redirection errors before later redirections apply - put
2>/dev/null BEFORE >&"$fd".