zsh

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package zsh renders completion results as the record stream consumed by the generated registration snippet and generates the #compdef registration snippets for the wire protocol (docs/completion-wire-protocol.md).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(toComplete string, directives wire.Directives, candidates []wire.Candidate) string

Format renders candidates and directives in the zsh framing: a directives record ("D", always first), an optional list-colors record ("L"), message records ("M"), and one candidate record ("C") per candidate.

Flag tag merging applies before framing: the "longhand flags" and "shorthand flags" tags merge into "flags" unless CONGA_MERGE_FLAGS is explicitly disabled. The noprefix directive is implied when the word being completed is empty: candidates are complete word replacements and zsh must not auto-insert into the buffer (compstate[insert]=""). The usage string folds into the message stream — deduplicated against the engine's own messages — so ActiveHelp hints and usage lines share the single _message -r channel. Candidate records are grouped by tag (first appearance, untagged candidates last) so the snippet emits exactly one _describe call per tag. toComplete only drives the noprefix rule and is otherwise ignored: the framing is position-independent.

func Snippet

func Snippet(name string, aliases []string, envPrefix string) string

Snippet renders the zsh registration script for the given command name and aliases (docs/completion-wire-protocol.md): the #compdef header (for fpath autoload) and a trailing compdef line (for sourcing) register one completer function for the command name and every alias. The single-command form names the function _<name>_completion; the multi-command form _<name>_completer, where <name> is the command name passed through wire.SanitizeIdentifier (registration lines keep the raw name, quoted via wire.QuoteTargetPOSIX). envPrefix is the application's normalized completion environment prefix (for example TASK_): the completer forwards the user's zstyle suppression choices through the application-prefixed sideband variable names.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL