ajeetdsouza/zoxide · error · RuntimeError

$PWD not found

Error message

$PWD not found

What it means

Error "$PWD not found" thrown in ajeetdsouza/zoxide.

Source

Thrown at templates/xonsh.txt:41

    zoxide = typing.cast(str, xonsh.environ.locate_binary("zoxide"))
    if zoxide is None:
        zoxide = "zoxide"
    return zoxide


def __zoxide_env() -> dict[str, str]:
    """Returns the current environment."""
    return builtins.__xonsh__.env.detype()  # type: ignore  # pylint:disable=no-member


def __zoxide_pwd() -> str:
    """pwd based on the value of _ZO_RESOLVE_SYMLINKS."""
{%- if resolve_symlinks %}
    pwd = os.getcwd()
{%- else %}
    pwd = __zoxide_env().get("PWD")
    if pwd is None:
        raise RuntimeError("$PWD not found")
{%- endif %}
    return pwd


def __zoxide_cd(path: str | bytes | None = None) -> None:
    """cd + custom logic based on the value of _ZO_ECHO."""
    if path is None:
        args = []
    elif isinstance(path, bytes):
        args = [path.decode("utf-8")]
    else:
        args = [path]
    _, exc, _ = xonsh.dirstack.cd(args)
    if exc is not None:
        raise RuntimeError(exc)
{%- if echo %}
    print(__zoxide_pwd())
{%- endif %}

View on GitHub (pinned to ee594e6906)

When it happens

Trigger: Thrown at templates/xonsh.txt:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ajeetdsouza/zoxide@ee594e6906 (2026-08-16). Data as JSON: /api/errors/d4ba72572b88ed27. Report an issue: GitHub.