refactor(shell): simplify zsh profile startup

Summary:
- Move reusable PATH setup into a shared .pathrc and source it from zsh
  login and interactive startup.
- Keep .zshenv minimal, and guard p10k, Oh My Zsh, and terminal-only
  setup so non-terminal shells stay quiet.
- Preserve Emacs vterm p10k support while skipping prompt-heavy setup in
  eshell-style sessions.

Rationale:
- The local profile had startup-time side effects, duplicate PATH/plugin
  setup, and non-terminal noise similar to the cleanup already done on
  dabel.
- Neutral helper names avoid personal prefixes in reusable profile code.

Tests:
- zsh -n ~/.zshenv ~/.zprofile ~/.zshrc ~/.pathrc
- zsh -lic 'print ok'
- INSIDE_EMACS=eshell TERM=dumb zsh -ic 'print ok; print theme=$ZSH_THEME'
- INSIDE_EMACS=vterm TERM=xterm-256color zsh -ic 'print ok; print theme=$ZSH_THEME'
- SSH_AUTH_SOCK=/tmp/test-sock zsh -lc 'printf "%s\n" "$SSH_AUTH_SOCK"'

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Petr Nyc
2026-06-05 13:36:44 +02:00
parent 4d6a76487f
commit bf5f2131b4
4 changed files with 308 additions and 414 deletions

1
.zprofile Normal file
View File

@@ -0,0 +1 @@
[[ -r "$HOME/.pathrc" ]] && . "$HOME/.pathrc"