Koh for zsh.
The Koh prompt shows where you are, what you have saved and whether anything is waiting. Tab completion keeps the commands and save IDs close at hand.
Install the plugin
01
Install the prompt and completions $
curl -fsSL https://koh.asha.software/shell/install.sh | sh The Koh installer offers this plugin too. This command installs it separately and adds one source line to your zsh configuration.
02
Open a new shell Step into a Koh repository and the segment appears. Everywhere else, your prompt carries on as usual.
Read the prompt
| Segment | Meaning |
|---|---|
| c-41 | This repository |
| v0.4.0 | The version declared by the project |
| · 41 saves | Its place on the line |
| · 5.4 MB | The whole repository on disk |
| ! | Unsaved changes |
| ⚑ | The save you are on has been flagged |
| → | Red when the last command failed |
Tab completion
Commands and options complete as you type. When a command needs a save, the last 30 appear with their messages. Pick the work you remember; Koh fills in the ID.
Settings and your own prompt
Settings
Set these before the source line in ~/.zshrc.
| Variable | Default | What it controls |
|---|---|---|
| KOH_COLOR_DIR | 73 | The folder's colour (a 256-colour number) |
| KOH_COLOR_VERSION | 214 | The version's colour |
| KOH_COLOR_META | 245 | The counts, the size and the prompt character |
| KOH_COLOR_ALERT | 203 | !, ⚑, and a prompt character after a failure |
| KOH_SHOW_VERSION | true | Show the version |
| KOH_SHOW_SAVES | true | Show the save count |
| KOH_SHOW_SIZE | true | Show the size |
| KOH_PROMPT_CHAR | → | The prompt character |
| KOH_BIN | koh | The binary the segment calls, if yours lives somewhere else |
| KOH_DEFAULT_PROMPT | true | Set to false to keep your own prompt |
Keep your own prompt
Set KOH_DEFAULT_PROMPT=false, then place $(koh_prompt) wherever the Koh segment belongs. Starship and Powerlevel10k can use the plain-text koh_prompt_info:
[custom.koh] command = "koh_prompt_info" when = "test -f .koh" shell = ["zsh"]