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 ofItems 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) — cachesMatchResults 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 oftermSets (OR groups), each containing one or moreterms (AND clauses). A term has atermType(fuzzy,exact,prefix,suffix,equal,exactBoundary) and aninvflag for negation. - Token / Range / Delimiter (
src/tokenizer.go) — used by--nth,--with-nth,--accept-nth. ARangeis a non-zero integer orBEGIN..ENDslice 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 byFuzzyMatchV2to 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 asbyChunk,byEnd,byBegin,byPathnameinsrc/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,EvtQuitenumerated insrc/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 byLightRenderer(src/tui/light.go) andTcellRenderer(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 insrc/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 likechange,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 theplaceholderregex insrc/terminal.go. - Become — replaces fzf's process with a child command at exit time (
actBecome, special exit codeExitBecome); seesrc/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 ongithub.com/charlievieth/fastwalk. Selected when stdin is a TTY andFZF_DEFAULT_COMMANDis unset. - walkerOpts (
src/options.go) —file,dir,hidden,followflags 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) —--tmuxre-execs fzf insidetmux 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 singleChunk. - 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.