mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-02 18:12:05 +08:00
在 open_provider_terminal 功能中添加了临时配置文件的自动清理逻辑, 确保在用户关闭终端窗口时自动删除创建的临时配置文件。 修改内容: - Linux: 使用 bash -c 嵌套包装脚本,通过 trap EXIT 信号在 shell 退出时清理配置文件 - macOS: 同样使用嵌套 bash + trap 机制来处理清理 - Windows: 保持原有的批处理文件自删除逻辑(del 命令) 技术细节: - 之前使用 sh -c "...; exec $SHELL" 会导致 trap 失效 - 现在使用 bash -c 'trap ... EXIT; ...; exec bash --norc --noprofile' - exec 会替换进程但保留 trap 信号处理器 - 当用户关闭终端时,EXIT 信号触发清理操作 影响范围: - src-tauri/src/commands/misc.rs (launch_terminal_with_env 函数) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>