v3.4.2
Fixed
- Unicode SIGABRT in
ctx_overview— directory path truncation used byte-index slicing (&dir[len-47..]) which panicked on multi-byte UTF-8 characters (Chinese, Japanese, Korean, emoji paths). Replaced withtruncate_start_char_boundary()that respects char boundaries. Fixes #154. - Windows shell detection in Git Bash / MSYS2 —
find_real_shell()now checksMSYSTEM/MINGW_PREFIXenv vars beforePSModulePath, preventing incorrect PowerShell detection when running inside Git Bash. Fixes #156.
Added
- Shell hint in MCP instructions (Windows) — on Windows, instructions now include detected shell type with explicit guidance (e.g. "SHELL: bash (POSIX). Use POSIX commands, not PowerShell cmdlets"), helping LLMs generate correct commands for the active shell environment.
- Shell mismatch hint in
ctx_shellresponses (Windows) — when a command fails and contains PowerShell cmdlets while the detected shell is POSIX, a correction hint is appended to the response. shell_name()public API — returns the short shell basename (e.g. "bash", "powershell", "cmd") for use in instructions and hints.
Upgrade
lean-ctx update # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.4.2...v3.4.2