ITADN

dangerous SC2164 recommendation

#3429Openmcandre 创建于 2026-03-25
M
mcandrecommented
ShellCheck provides toxic advice for `cd` customization lines, for example in .zshrc configuration files. SC2164 insists on triggering `exit` or `return` when change directory fails. Wouldn't `exit` force the entire shell session to terminate? Frankly, `cd` has its own exit codes. Why not simply allow those to propagate normally, instead of trying to wrap cd's exit codes in inherently worse error handling code?
3 条评论