From fef417bdb6a1c9859580a67495f85f94076abfa0 Mon Sep 17 00:00:00 2001 From: FlintyLemming Date: Thu, 2 Apr 2026 17:37:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20proxy=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20HTTP=20=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- fish/add-on.fish | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/fish/add-on.fish b/fish/add-on.fish index 21283d9..d5b2133 100644 --- a/fish/add-on.fish +++ b/fish/add-on.fish @@ -139,4 +139,19 @@ abbr -a port 'sudo ss -tulnp | grep' abbr -a process 'sudo ps aux | grep' abbr -a service 'sudo systemctl list-units --type=service --all | grep' -alias fastfetch="fastfetch --color-keys blue" \ No newline at end of file +alias fastfetch="fastfetch --color-keys blue" + +function proxy --description 'Set HTTP proxy for current session' + echo -n "HTTP proxy address (e.g. http://192.168.5.14:6152): " + read proxy_addr + + if test -n "$proxy_addr" + set -gx HTTP_PROXY "$proxy_addr" + set -gx HTTPS_PROXY "$proxy_addr" + echo "Proxy set: $proxy_addr" + else + echo "Proxy cleared" + set -e HTTP_PROXY + set -e HTTPS_PROXY + end +end \ No newline at end of file