{"record":{"id":"9231480763b7226f","repo":"kovidgoyal/kitty","slug":"zsh-anchor-based-matching-active-cannot-complete","errorCode":null,"errorMessage":"ZSH anchor based matching active, cannot complete. Turn it off by setting zstyle :completion: to something that does not use anchors in your ~/.zshrc","messagePattern":"ZSH anchor based matching active, cannot complete\\. Turn it off by setting zstyle :completion: to something that does not use anchors in your ~/\\.zshrc","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"tools/cli/zsh.go","lineNumber":69,"sourceCode":"var debugprintln = tty.DebugPrintln\nvar _ = debugprintln\n\nfunc zsh_input_parser(data []byte, shell_state map[string]string) ([][]string, error) {\n\tmatcher := shell_state[\"_matcher\"]\n\tq := \"\"\n\tif matcher != \"\" {\n\t\tq = strings.Split(strings.ToLower(matcher), \":\")[0][:1]\n\t}\n\tif q != \"\" && strings.Contains(\"lrbe\", q) {\n\t\t// this is zsh anchor based matching\n\t\t// https://zsh.sourceforge.io/Doc/Release/Completion-Widgets.html#Completion-Matching-Control\n\t\t// can be specified with matcher-list and some systems do it by default,\n\t\t// for example, Debian, which adds the following to zshrc\n\t\t// zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'\n\t\t// For some reason that I dont have the\n\t\t// time/interest to figure out, returning completion candidates for\n\t\t// these matcher types break completion, so just abort in this case.\n\t\treturn nil, fmt.Errorf(\"ZSH anchor based matching active, cannot complete. Turn it off by setting zstyle :completion: to something that does not use anchors in your ~/.zshrc\")\n\t}\n\treturn shell_input_parser(data, shell_state)\n}\n\nfunc (self *Match) FormatForCompletionList(max_word_len int, f *markup.Context, screen_width int) string {\n\tword := self.Word\n\tdesc := self.Description\n\tif desc == \"\" {\n\t\treturn word\n\t}\n\tword_len := wcswidth.Stringwidth(word)\n\tline, _, _ := strings.Cut(strings.TrimSpace(desc), \"\\n\")\n\tdesc = f.Prettify(line)\n\n\tmultiline := false\n\tmax_desc_len := screen_width - max_word_len - 3\n\tif word_len > max_word_len {\n\t\tmultiline = true","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/cli/zsh.go#L51-L87","documentation":"kitty's shell completion for zsh detected that the user's zstyle matcher-list configuration uses anchor-based matching (e.g. 'r:|[._-]=* r:|=* l:|=*', common in Debian's default zshrc). kitty's completion generator cannot produce working candidates under those matcher types, so it aborts completion instead of emitting broken results.","triggerScenarios":"zsh_input_parser inspects the completion context data and detects anchor matchers in the matcher-list zstyle; it returns this error and completion produces nothing.","commonSituations":"Debian/Ubuntu systems whose /etc/zsh/zshrc ships anchor-based matcher-list entries, or users who copied popular zshrc snippets (e.g. 'r:|[._-]=* r:|=* l:|=*') into ~/.zshrc, then invoke kitty's zsh completion.","solutions":["Edit your ~/.zshrc (or comment the Debian system zshrc line) and change zstyle ':completion:*' matcher-list to remove 'r:|=*' / 'l:|=*' anchor patterns, e.g. zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}'","Restart zsh or start a new shell after editing","If you need those matchers for other commands, scope them narrowly instead of ':completion:*'"],"exampleFix":"# before\nzstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=* l:|=*'\n# after\nzstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}'","handlingStrategy":"validation","validationCode":"if grep -q 'r:|=*' <(zstyle -L ':completion:*' matcher-list) 2>/dev/null; then echo 'disable anchor matchers before using kitty completion'; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the completion matcher-list free of r:|=* / l:|=* anchors","Scope fancy matchers to specific command contexts, not ':completion:*'"],"tags":["kitty","zsh","shell-completion","configuration"],"backgroundTag":"shell-completion-config-error","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}