diff --git a/fish/add-on.fish b/fish/add-on.fish index 8ecd03d..4614024 100644 --- a/fish/add-on.fish +++ b/fish/add-on.fish @@ -54,25 +54,8 @@ function restore_cursor --on-event fish_postexec tput cnorm end -# --- 自动化 Locale 修复逻辑 --- -# 只有在当前环境不支持 UTF-8 时才介入,修复例如 nano 无法输入中文的问题 -if not string match -qi "*UTF-8" "$LANG" - # 定义尝试顺序:C.UTF-8 (最通用) -> en_US.UTF-8 (最标准) -> 其他已安装的 UTF-8 - if locale -a | string match -q "C.utf8" - set -gx LANG C.UTF-8 - set -gx LC_ALL C.UTF-8 - else if locale -a | string match -qi "en_US.utf8" - set -gx LANG en_US.UTF-8 - set -gx LC_ALL en_US.UTF-8 - else - # 如果以上都没有,自动寻找系统里任何一个可用的 UTF-8 语言包 - set -l any_utf8 (locale -a | string match -ri '.*\.utf8' | head -n 1) - if test -n "$any_utf8" - set -gx LANG $any_utf8 - set -gx LC_ALL $any_utf8 - end - end -end +set -gx LANG C.UTF-8 +set -gx LC_ALL C.UTF-8 abbr -a port 'sudo ss -tulnp | grep' abbr -a process 'ps aux | grep' \ No newline at end of file