SUMMARY Following https://community.kde.org/Get_Involved/development#Set_up_kdesrc-build , I let `./kdesrc-build --initial-setup` make changes to my .zshrc. But when I ran source ~/.zshrc, it failed with "command not found: complete". STEPS TO REPRODUCE 1. Be using zsh (I'm using Fedora 34's zsh 5.8) 2. Follow steps to set up in https://community.kde.org/Get_Involved/development 3. Enter ./kdesrc-build --initial-setup , enter 'y' when it prompts "* Update your /home/spage/.zshrc? (y/N)" 4. Enter source ~/.zshrc OBSERVED RESULT home/spage/.zshrc:125: command not found: complete zsh has a different completion system to bash. EXPECTED RESULT I don't know. I spent some time with https://stackoverflow.com/questions/3249432/can-a-bash-tab-completion-script-be-used-in-zsh , but adding `bashcompinit` or `autoload bashcompinit` before the function _comp-kdesrc-run didn't help 🙁. SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.21.5 KDE Frameworks Version: 5.82.0 Qt Version: 5.15.2 on Wayland
Can reproduce this bug on Arch Linux using the same repro steps Operating System: Arch Linux KDE Plasma Version: 5.22.5 KDE Frameworks Version: 5.87.0 Qt Version: 5.15.2 Kernel Version: 5.14.11-arch1-1 (64-bit) Graphics Platform: X11 Processors: 16 × AMD Ryzen 7 1700 Eight-Core Processor Memory: 31.3 GiB of RAM Graphics Processor: Radeon RX 580 Series
Adding `autoload -U +X bashcompinit && bashcompinit` before the call to `complete` removed the error for me.
I have added a tiny note on wiki page : https://community.kde.org/index.php?title=Get_Involved/development&diff=prev&oldid=93638
Confirming. The completion function is bash-only, and we're putting it into .zshrc. zsh does have a bash compatibility plugin (`bashcompinit`), but 1) this is not loaded by default on many systems (including Neon), and 2) loading the bash layer also requires loading a broad set of zsh completions which the user might not want. It seems to me that the correct path forward is to: 1) Test for the presence of the bash compatibility layer, and if it is not present then don't put bash code into .zshrc 2) Create a zsh-specific completion function I'll create a merge request for #1 and look into #2.
A possibly relevant merge request was started @ https://invent.kde.org/sdk/kdesrc-build/-/merge_requests/172
FYI, there is another MR open for a zsh completion function: https://invent.kde.org/sdk/kdesrc-build/-/merge_requests/165
This is not installed now.