Problem
KIMI_CODE_HOME is returned verbatim by the CLI path helper. A commonly used value such as KIMI_CODE_HOME="~/.local/share/kimi-code" therefore remains a relative path containing a literal ~, instead of resolving under the user's home directory.
This is easy to trigger because environment-variable values are often quoted in shell profiles, where tilde expansion does not occur.
Proposed behavior
Expand only these forms:
~ to the current home directory
~/... (and the platform separator equivalent) under the current home directory
Keep other values unchanged, including ~user/..., to avoid implementing user-account lookup semantics.
Scope
- centralize the expansion in the CLI data-path helper
- add focused unit tests
- document the supported behavior in the English and Chinese environment-variable references
Problem
KIMI_CODE_HOMEis returned verbatim by the CLI path helper. A commonly used value such asKIMI_CODE_HOME="~/.local/share/kimi-code"therefore remains a relative path containing a literal~, instead of resolving under the user's home directory.This is easy to trigger because environment-variable values are often quoted in shell profiles, where tilde expansion does not occur.
Proposed behavior
Expand only these forms:
~to the current home directory~/...(and the platform separator equivalent) under the current home directoryKeep other values unchanged, including
~user/..., to avoid implementing user-account lookup semantics.Scope