#914569 beets: zsh completion broken

Package:
src:beets
Source:
beets
Submitter:
Clint Adams
Date:
2026-01-01 18:47:03 UTC
Severity:
normal
Tags:
#914569#5
Date:
2018-11-25 03:15:04 UTC
From:
To:
% beet import ../<TAB>
_beet:zregexparse:4: invalid regex : )

(with zsh 5.6.2-3)

#914569#10
Date:
2019-12-25 06:57:03 UTC
From:
To:
Hi Clint (2018.11.25_05:15:04_+0200)

Works for me, with zsh 5.7.1-1+b1.

Something changed in zsh? Or something unusual about the directory you
were in?

SR

#914569#19
Date:
2020-01-04 01:19:17 UTC
From:
To:
Could you perform a successful beet completion and then paste the output of
`which _beet`. so I can contrast the zregexparse line against

	zregexparse -c _ra_p1 _ra_p2 "$_ra_line" $'/[^\0]##\0/' $'(' $'(' $'/-c\0/' $'/[^\0]##\0/' $':_ra_comp $\'file:file:_files\'' $'|' $'/-v\0/' $'|' $'/-l\0/' $'/[^\0]##\0/' $':_ra_comp $\'file:file:_files\'' $'|' $'/-h\0/' $'|' $'/-d\0/' $'/[^\0]##\0/' $':_ra_comp $\'dir:directory:_dirs\'' $'|' $'/[]/' $':_ra_comp $\'options:global options:(( -c\\\\:path\\\\ to\\\\ configuration\\\\ file -v\\\\:print\\\\ debugging\\\\ information -l\\\\:library\\\\ database\\\\ file\\\\ to\\\\ use -h\\\\:show\\\\ this\\\\ help\\\\ message\\\\ and\\\\ exit -d\\\\:destination\\\\ music\\\\ directory ))\'' $')' $'#' $')' $')'

#914569#24
Date:
2026-01-01 18:44:06 UTC
From:
To:
Hi, zsh completion works for me. I presume this is a very stale bug and
we can close it.

In case it's not I'm providing the requested zregexparse:

_beet () {
     local _ra_p1 _ra_p2 _ra_left _ra_right _ra_com expl tmp
nm="$compstate[nmatches]"
     local _ra_actions _ra_line="${(pj:\0:)${(@)words[1,CURRENT -
1]:Q}}"$'\0'"$PREFIX"
     _ra_actions=()
     zregexparse -c _ra_p1 _ra_p2 "$_ra_line" $'/[^\0]##\0/' $'(' $'('
$'/-c\0/' $'/[^\0]##\0/' $':_ra_comp $\'file:file:_files\'' $'|'
$'/-v\0/' $'|' $'/-l\0/' $'/[^\0]##\0/' $':_ra_comp
$\'file:file:_files\'' $'|' $'/-h\0/' $'|' $'/-d\0/' $'/[^\0]##\0/'
$':_ra_comp $\'dir:directory:_dirs\'' $'|' $'/[]/' $':_ra_comp
$\'options:global options:(( -c\\\\:path\\\\ to\\\\ configuration\\\\
file -v\\\\:print\\\\ debugging\\\\ information -l\\\\:library\\\\
database\\\\ file\\\\ to\\\\ use -h\\\\:show\\\\ this\\\\ help\\\\
message\\\\ and\\\\ exit -d\\\\:destination\\\\ music\\\\ directory
))\'' $')' $'#' $')' $'(' $'/config\0/' $':_ra_comp
$\'subcmds:subcommands:((config:show\\\\ or\\\\ edit\\\\ the\\\\
user\\\\ configuration))\'' $'(' $'/[^\0]##\0/' $':_ra_comp
$\'option:option:{_beet_subcmd config}\'' $')' $'#' $'|' $'/fields\0/'
$':_ra_comp $\'subcmds:subcommands:((fields:show\\\\ fields\\\\
available\\\\ for\\\\ queries\\\\ and\\\\ format\\\\ strings))\'' $'('
$'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd fields}\''
$')' $'#' $'|' $'/help\0/' $':_ra_comp
$\'subcmds:subcommands:((help:give\\\\ detailed\\\\ help\\\\ on\\\\
a\\\\ specific\\\\ sub-command))\'' $'(' $'/[^\0]##\0/' $':_ra_comp
$\'option:option:{_beet_subcmd help}\'' $')' $'#' $'|' $'/import\0/'
$':_ra_comp $\'subcmds:subcommands:((import:import\\\\ new\\\\
music))\'' $'(' $'/[^\0]##\0/' $':_ra_comp
$\'option:option:{_beet_subcmd import}\'' $')' $'#' $'|' $'/list\0/'
$':_ra_comp $\'subcmds:subcommands:((list:query\\\\ the\\\\ library))\''
$'(' $'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd list}\''
$')' $'#' $'|' $'/modify\0/' $':_ra_comp
$\'subcmds:subcommands:((modify:change\\\\ metadata\\\\ fields))\'' $'('
$'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd modify}\''
$')' $'#' $'|' $'/move\0/' $':_ra_comp
$\'subcmds:subcommands:((move:move\\\\ or\\\\ copy\\\\ items))\'' $'('
$'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd move}\'' $')'
$'#' $'|' $'/remove\0/' $':_ra_comp
$\'subcmds:subcommands:((remove:remove\\\\ matching\\\\ items\\\\
from\\\\ the\\\\ library))\'' $'(' $'/[^\0]##\0/' $':_ra_comp
$\'option:option:{_beet_subcmd remove}\'' $')' $'#' $'|' $'/stats\0/'
$':_ra_comp $\'subcmds:subcommands:((stats:show\\\\ statistics\\\\
about\\\\ the\\\\ library\\\\ or\\\\ a\\\\ query))\'' $'('
$'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd stats}\'' $')'
$'#' $'|' $'/update\0/' $':_ra_comp
$\'subcmds:subcommands:((update:update\\\\ the\\\\ library))\'' $'('
$'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd update}\''
$')' $'#' $'|' $'/version\0/' $':_ra_comp
$\'subcmds:subcommands:((version:output\\\\ version\\\\ information))\''
$'(' $'/[^\0]##\0/' $':_ra_comp $\'option:option:{_beet_subcmd
version}\'' $')' $'#' $'|' $'/write\0/' $':_ra_comp
$\'subcmds:subcommands:((write:write\\\\ tag\\\\ information\\\\ to\\\\
files))\'' $'(' $'/[^\0]##\0/' $':_ra_comp
$\'option:option:{_beet_subcmd write}\'' $')' $'#' $')'
     case "$?" in
         (0 | 2) _message "no more arguments" ;;
         (1) if [[ "$_ra_line[_ra_p1 + 1, -1]" = *$'\0'* ]]
             then
                 _message "parse failed before current word"
             else
                 _ra_left="$_ra_line[_ra_p1 + 1, _ra_p2]"
                 _ra_right="$_ra_line[_ra_p2 + 1, -1]"
                 compset -p $(( $#PREFIX - $#_ra_line + $_ra_p1 ))
                 (( $#_ra_actions )) && _alternative "$_ra_actions[@]"
             fi ;;
         (3) _message "invalid regex" ;;
     esac
     [[ nm -ne "$compstate[nmatches]" ]]
}

Br,

Pieter