If yourDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/romkatv/powerlevel10k/llms.txt
Use this file to discover all available pages before exploring further.
~/.zshrc loads slow plugins — such as pyenv, nvm, or a plugin manager that initializes many tools — you may notice a noticeable pause before your shell becomes usable. Instant prompt eliminates this delay by printing your prompt immediately, before any plugin has finished loading, so you can start typing the moment the terminal window opens.
How It Works
When instant prompt is active, Powerlevel10k intercepts the very beginning of Zsh initialization:- It reads a previously cached prompt from
${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zshand prints it to the terminal immediately. - Standard input is redirected to
/dev/nullfor the duration of Zsh initialization, preventing initialization code from accidentally reading from the terminal. - Standard output and standard error are redirected to a temporary file, buffering any output that plugins emit during startup.
- Once Zsh is fully initialized, the standard file descriptors are restored and the content of the temporary file is flushed to the terminal.
Instant prompt requires Zsh ≥ 5.4. On older versions the feature is silently disabled and
~/.zshrc continues to load in the normal, sequential way.Enabling Instant Prompt
Run the configuration wizard
The simplest way to enable instant prompt is through
p10k configure. On the Instant Prompt screen, select Verbose (recommended for first-time use) or Quiet.Or add the snippet manually
Add the following block as close to the top of Copy the lines verbatim. Do not replace
~/.zshrc as possible, before any other initialization code that does not require console input:source with another method, do not add zcompile, and do not redirect output.Ensure ~/.p10k.zsh is sourced at the bottom of ~/.zshrc
The wizard adds this line automatically. If you added the snippet manually, verify it is present:
Controlling the Warning Level
ThePOWERLEVEL9K_INSTANT_PROMPT parameter in ~/.p10k.zsh controls how Powerlevel10k responds when it detects console output during initialization:
| Value | Behavior |
|---|---|
verbose | Print a warning when console output is detected during initialization. Recommended for new users. |
quiet | Enable instant prompt but suppress the warning. Use this when you know a plugin prints output on startup and it is harmless. |
off | Disable instant prompt entirely. Use this if instant prompt breaks your Zsh setup and you cannot identify the cause. |
p10k configure and adjusting the Instant Prompt selection.
Caveats
Output may appear uncolored. Code that prints to stdout or stderr during initialization will have its output buffered and replayed after the prompt. Colors from escape sequences may not survive the buffering, so the output can appear plain. You can suppress such output with>/dev/null, move it above the instant prompt block, or set POWERLEVEL9K_INSTANT_PROMPT=quiet to silence the warning.
Broken vs. Fixed ~/.zshrc Example
The following ~/.zshrc breaks when instant prompt is enabled because keychain prompts for a passphrase after stdin has been redirected to /dev/null, and chatty-script floods the buffered output:
direnv Integration
direnv needs to both export environment variables before the prompt renders (so the prompt reflects the correct environment) and register its hook after Zsh is initialized. With instant prompt active, add one line above and one line below the instant prompt block:Exporting GPG_TTY
If you use GPG with a passphrase agent, exportGPG_TTY anywhere in ~/.zshrc using $TTY:
export GPG_TTY=$(tty), which spawns a subshell.