Skip to content

Shell errors when using nounset option #13701

@demccormack

Description

@demccormack

Describe the bug

I use the nounset option set -u in my terminals to prevent silly mistakes. When using this option Oh My Zsh throws errors due to unset variables.

Steps to reproduce

To reproduce, insert

set -u

into the top of your ~/.zshrc and open a new terminal. You will see errors like

_defer_async_git_register:2: RPROMPT: parameter not set                                                
git_prompt_info:1: _omz_git_prompt_info: parameter not set

Expected behavior

There should be no shell errors

Screenshots and recordings

Image

OS / Linux distribution

macOS 26.4.1

Zsh version

5.9

Oh My Zsh version

master (e42ac8c)

Terminal emulator

iTerm2

If using WSL on Windows, which version of WSL

None

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions