feat: 提升 Zsh 重置安全性与启动性能#40
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces user-owned aliases (~/.config/zsh/local/aliases.zsh) that are preserved across updates and clean/reset flows, including migration logic for legacy aliases with sensitive value redaction. It also optimizes Homebrew path initialization, hides fast startup timing reports by default, improves fzf tmux integration, and compiles the zsh completion dump. The review feedback highlights two important issues: first, the glob pattern for checking the completion cache should be tightened to exclude empty files (using N.m-7L+0 instead of Nm-7) to prevent loading errors; second, the legacy alias syntax validation using spawnSync should explicitly check for a null status to avoid false validation failures in environments where zsh is not installed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Zsh startup benchmarkUbuntu 24.04 with Linuxbrew, atuin, fnm, fzf, zoxide, zinit, and the shipped plugins. Lower is better. Warm startup (daily use)
Cache-miss startupCompletion and tool-init caches are removed before every run; installed tools and plugins remain.
|
背景
改动
~/.config/zsh/local/aliases.zsh,setup/append 初始化并加载,clean/reset 保留。~/.config/suitup/aliases中有效、无冲突的单行 alias;同名 alias 和非 alias 内容保留在旧文件并只报告数量。fnm install --lts --use && fnm default "$(fnm current)"安装最新 Node LTS,移除 curl/jq 查询和固定版本兜底。验证
npm test关注点
.zshrc/ legacy aliases 中的本地环境变量或凭据手动迁移到local/machine.zsh或local/secrets.zsh。