fix: install clashon wrappers and clarify post-install shell behavior

This commit is contained in:
wnlen
2026-04-20 17:04:11 +08:00
parent b89e75fa6f
commit 80f11383ac
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -287,9 +287,9 @@ cmd_on() {
if [ "$system_proxy_degraded" = "true" ]; then
ui_warn "当前通过 clashctl 子进程执行,不能修改当前 Shell 代理变量"
else
ui_warn "当前通过 clashctl 子进程执行,已开启系统代理,但不会修改当前 Shell 代理变量"
ui_warn "当前通过 clashctl 子进程执行,已开启系统代理,但不会修改当前终端的 Shell 变量"
fi
ui_next "需要当前 Shell 立即生效:source shell 入口后执行 clashon,或重新打开终端"
ui_next "当前终端如需立即生效:重新打开终端后使用 clashon,或手动 source shell 入口"
ui_blank
fi
+6
View File
@@ -2436,6 +2436,8 @@ EOF
for shell_rc in "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.profile"; do
install_rc_source_block "$shell_rc" "$profile_file"
done
install_alias_command_wrappers
}
remove_clashctl_entry() {
@@ -2925,4 +2927,8 @@ print_install_summary() {
if [ -f "$clashctl_file" ]; then
CLASH_UI_BOX_ONLY=1 bash "$clashctl_file" ui || true
fi
echo
echo "💡 clashon / clashoff 为 shell 快捷入口;新终端会自动生效"
echo "💡 当前终端若暂不可用,请先使用 clashctl on / clashctl off"
}