macOS cc-switch version detection error / freeze
Quick fix
Modify the fastfetch call in .zshrc to add a [[ -t 1 ]] check for non-interactive output.
Symptom
Section titled “Symptom”mac 版本在检查到新版本后,点击按钮更新之后每次都会卡死。After detecting a new version, clicking the update button causes the Mac app to freeze every time.
On macOS, cc-switch runs `zsh -lic` to detect tool versions (such as Codex/Claude Code). If your shell config file (e.g., ~/.zshrc) contains commands that execute unconditionally (like `fastfetch`), these may output extra information to stdout when a non-interactive subshell starts (e.g., system version numbers or ASCII art).
cc-switch uses `.find()` to get the first version string. When tools like `fastfetch` output a version number before the actual CLI tool (e.g., mistakenly identifying macOS system version `15.7.9` as the tool version), the frontend thinks the current version is higher than the latest remote version, causing the UI to show "Ready" and the upgrade button to miscalculate. Additionally, some users report the client freezing during this process.
Open the terminal and edit your zsh configuration file.
~/.zshrcFind lines calling fastfetch (or other commands that may output text) and prepend a conditional check `[[ -t 1 ]] &&` to ensure it only executes in a genuine interactive terminal.
~/.zshrc
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 16 real issues
- #5178winget 安装的claude code识别不了
- #928版本3.10.3的热切换失效
- #3048如何还原Claude Desktop Official的配置
- #4791MacOS brew upgarde cc-switch reduced version
- #4845“模型测试”按钮
- #1346CC-SWITCH 配置完成后,一直处于正在思考
- #4737claude-haiku-4-5-20251001 一直429 ccs最新版本
- #5769[BUG]grok build 0.2.112升级后会显示需要身份验证
- #2660复制配置会导致无法使用
- #2918Claude Desktop 今日更新最新版本后,自定义配置失效
- #3956ubuntu 自动更新
- #3937mac版本检查错误问题
- #4907最小化后再打开会卡顿几秒
- #6539软件无法自动更新skill目录
- #6774claude code思考强度字段自定义映射
- #6797关于新版本的PI配置部分获取不到模型问题
- Why does this issue not occur on other platforms?
- This issue primarily stems from the default behavior of the macOS zsh shell and interference from specific plugins (like fastfetch) outputting data in non-interactive environments. Windows (PowerShell/CMD) and Linux shell environments typically do not inject such metadata into the version detection pipeline in the same way.
- Are there other causes for version detection errors besides fastfetch?
- Yes. Any command in ~/.zshrc, ~/.bash_profile, or ~/.profile that executes unconditionally and outputs strings containing version numbers can cause this problem. Check if similar tools like neofetch, screenfetch, or custom scripts are outputting large amounts of text at startup.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.