lean-ctx icon indicating copy to clipboard operation
lean-ctx copied to clipboard

bug: `lean-ctx update` creates .zshenv even though I don't have zsh installed

Open teadatuntud opened this issue 6 months ago • 1 comments

lean-ctx version: (run lean-ctx --version) lean-ctx 3.6.22 (official, https://github.com/yvgude/lean-ctx)

OS: (macOS / Linux / Windows) Linux

AI tool: (Cursor / Claude Code / Copilot / Crush / other) N/A -- this is run in the terminal

What happened: The file .zshenv was created.

What you expected: .zshenv not to be created, because I don't have zsh installed.

Steps to reproduce:

  1. When a new version is available, run lean-ctx update

teadatuntud avatar May 28 '26 14:05 teadatuntud

Fixed in v3.6.23 (released).

Root cause: install_all_with_style() unconditionally wrote shell hooks for both zsh and bash, regardless of whether the shell binary existed on the system.

Fix: Added a shell_available() check that verifies the shell binary exists (checks /bin/zsh, /usr/bin/zsh, /usr/local/bin/zsh, /opt/homebrew/bin/zsh) before installing the hook. Systems with only bash installed will no longer get a .zshenv file created.

The fix will be available via lean-ctx update once v3.6.23 propagates to npm/crates.io (usually within a few minutes of release).

yvgude avatar May 28 '26 15:05 yvgude