• andforce
     unalias rm 2>/dev/null
     function rm {
       local args=()
       for arg in "$@"; do
         case "$arg" in
           -*) ;;  # 跳过所有 flag ,只保留文件路径
           *) args+=("$arg") ;;
         esac
       done
       if [[ ${#args[@]} -eq 0 ]]; then
         echo "rm: missing operand"
         return 1
       fi
       trash "${args[@]}"
     }
    ```放到 Mac 的 ~/.zshrc 中,这样所有删除都会进入回收站
    主楼
  • liuxue

    如果 ai 不使用你的环境变量,不还是会出问题么

    #1
  • ruanimal

    你没有用过 trash-cli 吗? 另外 ai 很喜欢用绝对路径,alias 其实作用也不大

    #2
  • cheng6563

    windows ,让 AI 糊了个 sbox.md ,sbox codex 这样启动 codex ,就建一个 sandboxie 区,只给当前目录设置完全访问,其他目录全走 sandboxie

    #3

发表回复

登录后回复