Skip to content

docs: Add async_prompt.zsh to OMZ theme migration guide #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Krymancer
Copy link
Contributor

@Krymancer Krymancer commented Jul 22, 2025

Description

This PR addresses an issue encountered when migrating from an Oh My Zsh theme (specifically robbyrussell) using Zinit's snippets. The git.zsh library, sourced via zi snippet OMZL::git.zsh, has a dependency on async_prompt.zsh which defines the _omz_register_handler function. Without async_prompt.zsh being sourced first, users would encounter a command not found: _omz_register_handler error.

This change adds zi snippet OMZL::async_prompt.zsh to the Oh My Zsh theme migration instructions in the documentation, ensuring that the necessary function is loaded before git.zsh is processed, thus resolving the error and making the migration guide more complete and functional.

Related Issue(s)

N/A - This resolves an un-reported setup issue identified during user setup.

Motivation and Context

The primary motivation is to provide a complete and error-free migration path for users transitioning from Oh My Zsh themes (like robbyrussell) to Zinit. The previous instructions led to a command not found error due to a missing dependency. By including async_prompt.zsh, users can seamlessly set up their environment as intended without encountering this specific error.

Usage examples

## Oh My Zsh Setting
ZSH_THEME="robbyrussell"
# Must Load OMZ async_prompt library for git.zsh dependency
zi snippet OMZL::async_prompt.zsh
# Must Load OMZ Git library
zi snippet OMZL::git.zsh
# Load Git plugin from OMZ
zi snippet OMZP::git
zi cdclear -q # <- forget completions provided up to this moment

setopt promptsubst
# Load Prompt
zi snippet OMZT::robbyrussell

How Has This Been Tested?

This change has been tested by replicating the initial error (command not found: _omz_register_handler) in a fresh Zsh environment configured with the previous documentation's steps. The error was successfully resolved by adding zi snippet OMZL::async_prompt.zsh as proposed, confirming that git.zsh and the theme now load without issues.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation change
  • New feature (non-breaking change which adds functionality)

Checklist:

  • All new and existing tests passed. (N/A for specific unit tests, but tested manually as described above.)
  • I have added tests to cover my changes. (N/A - documentation change)
  • I have updated the documentation accordingly.

@pschmitt pschmitt merged commit c84533b into zdharma-continuum:main Jul 23, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants