Fixed
- UTF-8 text corrupted on Windows PowerShell (#131):
lean-ctx -cwith non-ASCII output (Russian, Japanese, Chinese, Arabic, etc.) produced mojibake becauseString::from_utf8_lossymisinterpreted Windows system codepage bytes as UTF-8. Introduceddecode_output()that tries UTF-8 first, then falls back to Win32MultiByteToWideCharfor proper codepage-to-Unicode conversion. On PowerShell, additionally injects[Console]::OutputEncoding = UTF8and setsSetConsoleOutputCP(65001). Fixed across shell hook, MCP server execute, and sandbox runners. - MCP
ctx_shellcommands hang on stdin (#132, credit: @xsploit): Child processes spawned by the MCP server inherited the JSON-RPC stdin pipe, causing commands likegitto block instead of receiving EOF. Fixed by settingstdin(Stdio::null())on all MCP child processes. AddedGIT_TERMINAL_PROMPT=0andGIT_PAGER=catto prevent interactive prompts.
Added
- MCP command timeout: Shell commands executed via
ctx_shellnow have a configurable timeout (default 120s). Override withLEAN_CTX_SHELL_TIMEOUT_MSenv var. Timed-out commands return exit code 124 with a clear error message. - Regression tests: Added
execute_command_closes_stdinandgit_version_returns_when_git_is_availabletests to prevent future stdin inheritance regressions.
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.2.9...v3.2.9