Files
tai/research/shell-multiplexer-auto-attach/oracle-docs-e88353-zshbuiltins-autoload-x.md
T
2026-10-10 09:25:33 +02:00

2.4 KiB

zshbuiltins(1): autoload -X (Oracle Solaris docs mirror)

Metadata

Field Value
Institute Molodetz Institute — Research & Retrieval Division
Subject shell-multiplexer-auto-attach
Document type Source Dossier
Tier 1
Source title zshbuiltins(1)
Source URL https://docs.oracle.com/cd/E88353_01/html/E37839/zshbuiltins-1.html
Source publisher / author Oracle (Solaris documentation, mirroring the upstream zsh manual)
Source type vendor docs
Source date (published) Unknown — not stated
Date researched 2026-10-10
Researched by tai (agent), model: Claude Sonnet 5, on behalf of retoor
Research method web search synthesis
Confidence High
Status Active

Summary

The formal zsh builtins manual definition of autoload -X: marks the calling function itself for autoloading, then immediately loads and executes it with the current positional parameters, failing with an error (and leaving the function undefined but marked for autoload) if no definition is found on $fpath.

Key findings

  • autoload -X is specifically for the case where a function calls itself recursively to trigger its own on-demand loading — exactly the trick the 2015 command_not_found_handler example (Tier 1, zsh-org-mla-2015-msg00931) uses.
  • This is a general zsh function-loading mechanism, not something specific to command_not_found_handler — it happens to be a convenient tool for implementing a dynamic handler, not a required part of defining one.

Pros / strengths

  • The authoritative formal definition, which let this research confirm precisely what the 2015 mailing-list example's autoload +X call was actually doing mechanically, rather than taking the example purely on faith.

Cons / limitations / caveats

  • Mirrored vendor documentation (Oracle's Solaris docs), not the canonical zsh.org manual itself; the content matches the well-known standard zsh behavior, so this is treated as a faithful, non-divergent mirror.

Relevance to tai

Confirmed that autoload -X is orthogonal to tai's own needs: ZSH_NOTFOUND_BLOCK defines a plain, statically-written command_not_found_handler with no dynamic loading, so this mechanism is not used in tai.py at all — this dossier's main value was ruling it out as something tai's own handler needed to account for.

Changelog

Date Change
2026-10-10 Initial dossier created.