Shell prompt¶
Show the active checkout in your prompt, the way git prompts show the current branch.
Inside a workspace with checkout demo active, the prompt gains a 🌲 demo prefix. Anywhere else it stays the same.
The snippet is plain shell and reads .forest/HEAD directly, so it never starts forest and the prompt stays fast. It walks up from the current directory, stops at the first directory holding .forest or .git, and shows the segment only if that directory has .forest/config.yaml and a valid checkout name in .forest/HEAD. Running the eval line twice is harmless.
To change the icon:
Framework notes¶
- With oh-my-zsh, powerlevel10k or another zsh theme, put the
evalline after the theme loads. Themes overwritePROMPTand would drop the segment. - If you use an array
PROMPT_COMMAND(bash 5.1+), the snippet's string prepend keeps only the first element. Register_forest_prompt_updateyourself instead. - If bash shows a literal
${FOREST_PROMPT},promptvarsis off. Runshopt -s promptvars.