From e2d0b555b5dfb218d9c13a421dbbd8e8530d99c8 Mon Sep 17 00:00:00 2001 From: sususu98 Date: Fri, 12 Dec 2025 13:54:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=96=B0=20shell=20=E4=BC=9A=E8=AF=9D=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在配置完成后询问用户是否启动新的 shell 会话, 以使环境变量立即生效,解决 "command not found" 问题。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- setup.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup.sh b/setup.sh index aa06157..ea74ae5 100755 --- a/setup.sh +++ b/setup.sh @@ -536,6 +536,17 @@ main() { else warning "有 $failed 个工具配置失败" fi + + # 询问是否启动新 shell 以使环境变量生效 + echo "" + echo -e "${YELLOW}是否启动新的 shell 会话以使环境变量立即生效? (Y/n)${NC}" + read -r -n 1 start_new_shell + echo "" + + if [[ ! "$start_new_shell" =~ ^[Nn]$ ]]; then + info "正在启动新的 shell..." + exec "$SHELL" -l + fi } main "$@"