mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-10-10 12:13:04 +08:00
Merge pull request #174 from wnlen/codex/establish-codex-bootstrap-document-lictjq
Clean defaults, add Codex bootstrap docs, and auto-select proxy relays
This commit is contained in:
@@ -74,6 +74,11 @@ _clash_alias_after_on() {
|
||||
_clash_alias_print_sep
|
||||
_clash_alias_proxy_show
|
||||
|
||||
if [ "${CLASH_WRAPPER_EXEC:-0}" = "1" ]; then
|
||||
echo "⚠️ 当前通过独立命令执行,Shell 变量不会自动回写到父终端"
|
||||
echo '💡 请在当前终端执行:eval "$(clashctl proxy on)"'
|
||||
fi
|
||||
|
||||
echo "👉 下一步:$(_clash_alias_status_next)"
|
||||
}
|
||||
|
||||
@@ -82,6 +87,9 @@ _clash_alias_after_off() {
|
||||
_clash_alias_print_sep
|
||||
echo "🔴 已关闭代理环境"
|
||||
echo "🧹 当前 Shell 代理变量已清理"
|
||||
if [ "${CLASH_WRAPPER_EXEC:-0}" = "1" ]; then
|
||||
echo '💡 若当前终端仍有代理变量,请执行:eval "$(clashctl proxy off)"'
|
||||
fi
|
||||
echo "🧭 新终端默认代理:已关闭"
|
||||
echo "👉 下一步:clashctl status"
|
||||
}
|
||||
|
||||
@@ -2178,6 +2178,39 @@ EOF
|
||||
ensure_command_install_dir_in_shell_path
|
||||
}
|
||||
|
||||
install_alias_command_wrappers() {
|
||||
local alias_file install_dir wrapper_name
|
||||
|
||||
alias_file="$(alias_source_file)"
|
||||
install_dir="$(command_install_dir)"
|
||||
|
||||
[ -f "$alias_file" ] || die "未找到 alias 脚本:$alias_file"
|
||||
|
||||
mkdir -p "$install_dir"
|
||||
|
||||
for wrapper_name in \
|
||||
clashon \
|
||||
clashoff \
|
||||
clashproxy \
|
||||
clashls \
|
||||
clashselect \
|
||||
clashui \
|
||||
clashsecret \
|
||||
clashtun \
|
||||
clashupgrade \
|
||||
clashmixin
|
||||
do
|
||||
cat > "$install_dir/$wrapper_name" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
export CLASH_WRAPPER_EXEC="1"
|
||||
source "$alias_file"
|
||||
$wrapper_name "\$@"
|
||||
EOF
|
||||
chmod +x "$install_dir/$wrapper_name"
|
||||
done
|
||||
}
|
||||
|
||||
cleanup_legacy_shell_entries() {
|
||||
local shell_rc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user