关闭烦人的[oh-my-zsh] Would you like to update? [Y/n]更新提示

1.懒人版解决方案(和下面的手动修改效果相同)

复制到终端直接回车

file=~/.zshrc; insert_line='DISABLE_UPDATE_PROMPT=true'; if ! grep -q "$insert_line" "$file"; then line_numbers=$(grep -n "source \$ZSH/oh-my-zsh.sh" "$file" | cut -d':' -f1); for line_number in $line_numbers; do sed -i "${line_number}i${insert_line}" "$file"; done; echo "已成功在 ~/.zshrc 中插入行:$insert_line"; else echo "已存在行:$insert_line,无需插入。"; fi

2.手动修改

Set environment variable DISABLE_UPDATE_PROMPT=true to always reply Yes and automatically upgrade.

Set environment variable DISABLE_AUTO_UPDATE=true to always reply No and never upgrade.

Simply add one of these in your ~/.zshrc somewhere before calling source $ZSH/oh-my-zsh.sh.


将环境变量DISABLE_UPDATE_PROMPT=true设置为始终“是”,并自动升级。

将环境变量DISABLE_AUTO_UPDATE=true设置为始终“否”,并永远不升级。

把上面任意一条添加进文件~/.zshrc中类似source $ZSH/oh-my-zsh.sh行的上方即可。

Last modification:September 1, 2023
V50%看看实力