#!/bin/bash

# Qwen Code 启动脚本
# 临时清除代理设置以避免与 Qwen Code 的冲突

echo "正在启动 Qwen Code..."
echo "临时清除代理设置..."

# 保存当前代理设置
SAVED_HTTP_PROXY="$http_proxy"
SAVED_HTTPS_PROXY="$https_proxy"
SAVED_HTTP_PROXY_UPPER="$HTTP_PROXY"
SAVED_HTTPS_PROXY_UPPER="$HTTPS_PROXY"

# 清除代理设置
unset http_proxy
unset https_proxy  
unset HTTP_PROXY
unset HTTPS_PROXY

echo "代理设置已临时清除"
echo "启动 Qwen Code..."

# 启动 Qwen Code
qwen

# 恢复代理设置
export http_proxy="$SAVED_HTTP_PROXY"
export https_proxy="$SAVED_HTTPS_PROXY"
export HTTP_PROXY="$SAVED_HTTP_PROXY_UPPER"
export HTTPS_PROXY="$SAVED_HTTPS_PROXY_UPPER"

echo "代理设置已恢复"