Skip to content
meltinPublic

About

A fast, customizable, asynchronous prompt for Zsh.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Nova

日本語版

An async zsh prompt that never makes you wait. Written in Rust.

Nova prompt demo

Nova draws the prompt from cheap, synchronous data and lets a per-shell worker fill in everything slow — Git status, runtime versions, your own commands — as it arrives. You can type the moment the prompt appears.

Highlights

  • Never blocks. git status, version probes, and custom commands run in a worker with per-segment timeouts; the prompt redraws when results land. Typical overhead is under 1 ms per prompt (command_lag_ms ≈ 0.75 ms).
  • Fast startup. Besides nova init and the worker itself, starting a shell forks nothing, and the worker begins collecting for your directory while the rest of .zshrc runs, so the first prompt usually arrives complete.
  • Optional transient prompt. Accepted lines can collapse to a few segments, such as the directory and ❯, keeping scrollback dense.
  • Custom segments. Turn any command into an async segment with a few lines of TOML.
  • Terminal integration. OSC 133 prompt marks (jump between prompts in Ghostty, WezTerm, kitty, iTerm2, and VS Code) and OSC 7 directory reports.
  • Configurable without recompiling. Layout, icons, colors, separators, timeouts, and cache lifetimes live in one TOML file, checked by nova check.

Requirements

  • zsh 5.8 or later
  • A Nerd Font for the default icons
  • Git, when Git segments are enabled

Installation

Release artifacts are published from Git tags by cargo-dist. The commands below work after the first GitHub Release is published.

Shell Installer

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/unmett/nova/releases/latest/download/nova-installer.sh | sh

Homebrew

brew install unmett/tap/nova

Nix

Run without installing:

nix run github:unmett/nova -- --help

Install into your profile:

nix profile install github:unmett/nova

mise

Use the GitHub backend:

mise use -g github:unmett/nova@latest

Nova does not document the ubi backend because mise warns that it is deprecated.

Shell Setup

Add this to your .zshrc after nova is installed:

eval "$(nova init zsh)"

For a temporary smoke test without touching your normal zsh configuration:

zsh -f
eval "$(nova init zsh)"

Configuration

Most users should put their config here:

~/.config/nova/config.toml

If XDG_CONFIG_HOME is set, Nova uses that base directory instead:

$XDG_CONFIG_HOME/nova/config.toml

Config lookup order:

  1. --config PATH
  2. $NOVA_CONFIG
  3. $XDG_CONFIG_HOME/nova/config.toml
  4. $HOME/.config/nova/config.toml

Use NOVA_CONFIG when you want to load an explicit config file:

NOVA_CONFIG=/path/to/config.toml

Start from the complete example:

nova_config="${XDG_CONFIG_HOME:-$HOME/.config}/nova/config.toml"
mkdir -p "$(dirname "$nova_config")"
curl --proto '=https' --tlsv1.2 -fsSL \
  https://raw.githubusercontent.com/unmett/nova/main/examples/config.toml \
  -o "$nova_config"
nova check --config "$nova_config"

Preview the prompt without starting an interactive shell:

nova prompt --format preview --cwd "$PWD" --cols "${COLUMNS:-80}" --duration-ms 2000 --time 11:16:42

Customize

Every key is documented in examples/config.toml. A few common recipes:

Collapse accepted lines to the directory, exit status, and prompt character:

[layout]
transient = ["dir", "exit_status", "prompt_char"]

Like the full prompt, each collapsed line shows the status of the command before it, so [127] and the red ❯ land on the line after a failure.

Show the Kubernetes context, but only in directories that have manifests:

[layout.line1]
left = ["dir", "git_branch", "git_status", "kube", "duration"]

[segments.kube]
command = "kubectl config current-context"
detect = ["k8s", "Chart.yaml"]
icon = "☸"
style = { fg = "cyan", bold = true }
ttl_ms = 5000

The command runs with sh -c in the prompt's directory, never blocks the prompt, and shows its first output line. Empty output or a failing exit status hides the segment.

Draw each segment on a rounded pill (uses each segment's style.bg, or a neutral gray):

[layout]
style = "capsule"

Turn off terminal integration sequences:

[terminal]
semantic_prompts = false
report_cwd = false

Resizing

When the terminal window shrinks, terminals that reflow text (Ghostty, kitty, iTerm2, and others) wrap any prompt line wider than the new width. zsh then redraws the prompt assuming the old row count and leaves stale copies of the first line above it. This is a limitation of zsh with reflowing terminals and affects other prompts too; see powerlevel10k's notes.

The default layout keeps line 1 left-aligned only, so this happens only when line 1 is wider than the new width. A right block on line 1 ([layout.line1] right = [...]) makes line 1 as wide as the terminal, so every shrink triggers it. To avoid it, leave layout.line1.right empty and put right-side segments in layout.line2.right, or turn off text reflow in your terminal if it has that setting.

Performance

Nova is measured with zsh-bench on every pull request; see docs/performance.md for the method and history. Async work is bounded by per-segment timeout_ms, and a timed-out probe is stopped together with any processes it started.

About

A fast, customizable, asynchronous prompt for Zsh.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages