Open-Source Wikis

/

fzf

/

fzf

/

Glossary

junegunn/fzf

Glossary

Terms that appear repeatedly in the codebase and the documentation. Where applicable, each entry points at the file or type that defines the concept.

Core data model

  • Item (src/item.go) — a single line of input plus its parsed presentation, ANSI offsets, and index.
  • Chunk / ChunkList (src/chunklist.go) — fixed-size arrays of Items that the Reader appends into. The Matcher snapshots the list when it scans, so reads are lock-free during a search.
  • ChunkCache (src/cache.go) — caches MatchResults keyed on (pattern, chunks) so identical scans don't repeat work.
  • Result / Merger (src/result.go, src/merger.go) — a scored, sorted view of matched items. The merger applies tiebreakers in the order specified by --tiebreak.
  • Pattern / term / termSet (src/pattern.go) — the compiled query. A pattern is a list of termSets (OR groups), each containing one or more terms (AND clauses). A term has a termType (fuzzy, exact, prefix, suffix, equal, exactBoundary) and an inv flag for negation.
  • Token / Range / Delimiter (src/tokenizer.go) — used by --nth, --with-nth, --accept-nth. A Range is a non-zero integer or BEGIN..END slice into tokens parsed with the configured delimiter (AWK-style by default).

Search and scoring

  • Algo (src/algo/algo.go) — function type for a matching algorithm. Variants: FuzzyMatchV1, FuzzyMatchV2, ExactMatchNaive, PrefixMatch, SuffixMatch, EqualMatch.
  • Slab (src/util/slab.go) — pre-allocated 16-bit / 32-bit scratch arrays reused by FuzzyMatchV2 to avoid per-scan allocation.
  • Bonus — extra score awarded at "special" positions (start of word, camelCase boundary, after a path separator). Defined in src/algo/algo.go.
  • Gap penalty — score deduction proportional to the distance between consecutive matched characters.
  • Tiebreak — secondary sort criteria when scores are equal: length, chunk, pathname, begin, end, index. Defined as byChunk, byEnd, byBegin, byPathname in src/options.go / src/core.go.
  • Scheme — preset bundle of scoring tweaks for a domain. default, path, history. Selected with --scheme.

Coordination

  • EventBox (src/util/eventbox.go) — a condition-variable + map combo used as fzf's primary message bus.
  • EventType — values like EvtReadNew, EvtReadFin, EvtSearchNew, EvtSearchProgress, EvtSearchFin, EvtQuit enumerated in src/core.go.
  • revision (src/core.go) — a (major, minor) counter bumped on input changes; used so the matcher can tell whether a returned result is still valid for the current input.
  • searchRequest (src/core.go) — payload sent from the Terminal to the Matcher whenever the query, sort flag, --nth, --with-nth, header lines, or denylist changes.

Terminal and rendering

  • Renderer (src/tui/tui.go) — interface implemented by LightRenderer (src/tui/light.go) and TcellRenderer (src/tui/tcell.go).
  • Window (src/tui/tui.go) — a sub-region of the terminal (list, preview, header, footer, border, etc.) with its own coordinate system.
  • BorderShape — none, rounded, sharp, bold, double, block, thinblock, horizontal, vertical, top, bottom, left, right, line, inline, native. Defined in src/tui/tui.go.
  • Attr (src/tui/tui.go) — bit-packed text attributes (bold, underline + style, reverse, blink, full-bg marker, etc.).
  • fitpad (src/core.go, src/terminal.go) — pair of values describing the height fzf should occupy and how much padding to leave; used to implement --height.

User interaction

  • Action / actionType (src/options.go, generated names in src/actiontype_string.go) — the unit of behavior bound to keys, mouse events, and HTTP commands. Examples: actAccept, actReload, actChangePreview, actBecome, actTransformQuery. Hundreds of action types.
  • Bind (src/options.go) — the parsed mapping of an event (key, mouse event, named event like change, focus, result, load, start, jump, one) to a list of actions.
  • Placeholder (src/terminal.go) — {}, {q}, {n}, {1..3}, {+f}, {fzf:query}, {fzf:action}, {fzf:prompt}, etc. Substituted into --preview, execute, become, reload, and friends. Parsed via the placeholder regex in src/terminal.go.
  • Become — replaces fzf's process with a child command at exit time (actBecome, special exit code ExitBecome); see src/proxy.go.
  • Reload / transform- — actions that invoke a shell command and feed its output back into fzf, either as new input (reload, reload-sync) or to replace state (transform-query, transform-prompt, transform-header, etc.).

Input sources

  • Walker (src/reader.go) — the built-in file system walker built on github.com/charlievieth/fastwalk. Selected when stdin is a TTY and FZF_DEFAULT_COMMAND is unset.
  • walkerOpts (src/options.go) — file, dir, hidden, follow flags controlling what the walker yields.
  • FZF_DEFAULT_COMMAND — environment variable used when no input is piped in and the walker is overridden.
  • Reader (src/reader.go) — wraps stdin / a child process / the walker / a Go channel and pushes lines into the chunk list.

Process modes

  • Tmux popup (src/tmux.go) — --tmux re-execs fzf inside tmux display-popup.
  • Zellij popup (src/zellij.go) — Zellij equivalent of the tmux popup.
  • Winpty (src/winpty.go, src/winpty_windows.go) — Windows fallback for terminals without ConPTY.
  • Filter mode--filter QUERY; fzf reads input, applies the pattern, prints the matches, exits. No UI.
  • Listen mode--listen [ADDR]; fzf starts an HTTP server (src/server.go) and accepts JSON action requests.

Misc

  • chunkSize (src/constants.go) — number of items in a single Chunk.
  • slab16Size / slab32Size (src/constants.go) — sizes of the per-partition slab buffers for the matcher.
  • coordinatorDelayStep / coordinatorDelayMax (src/constants.go) — adaptive sleep used by the main coordinator loop while the reader is still active.
  • ExitOk / ExitNoMatch / ExitError / ExitInterrupt / ExitBecome (src/constants.go) — fzf's exit code conventions.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Glossary – fzf wiki | Factory