Compinit zsh The auto-completion with zsh works fine with the system commands like cd , etc ,ls,… How can the auto-completion be enabled with zsh for Docker? ( The laptop is running Fedora 33 Oct 24, 2022 · I have zsh enabled globally on nix-darwin and on new users I am getting the following warning in the terminal: zsh compinit: insecure directories and files, run compaudit for list. Oct 30, 2023 · Step-by-step guide to resolving the 'zsh compinit: insecure directories' error after installing Homebrew on macOS. If you could share your . Apr 16, 2021 · 显然,根据ZSH手册, bashcompinit 必须在 compinit 之后被调用 (不确定它是否相关)。现在的问题是,当第二个脚本调用 compinit 时,来自第一个脚本的逻辑就消失了 (即第一个脚本没有完成)。复制此代码的一个简单片段 (从 这里 复制): Disabling System-Wide compinit Call (Ubuntu) On Ubuntu users might get surprised that e. An incredible theme and tool called powerlevel10k that fixes a lot of the most common complaints. Nov 29, 2022 · I'm trying to learn how autocompletion works in zsh. zshrc file, then I would be able to tell you where you should run it in your case exactly. Zsh Prompt Theme Zsh themes for prompts screenshots Zsh Resources Oh-My-Zsh Wiki Resources specific to Debian's Zsh Package Jenkins Autobuilder hosted by Grml using Jenkins Debian Glue DebCI results for Zsh Packaging Workflow (incomplete) Debian Zsh Packaging Team aka pkg-zsh. Thanks to this Oct 22, 2023 · When I open zsh on vs code terminal, the warning compinit:527: no such file or directory: /usr/local/share/zsh/site-functions/_docker_compose appear on it. Dec 28, 2020 · You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Jan 16, 2021 · worked because zsh-completions actually recreates symbolic links for _brew which is the same given in my answer replacing missing or incorrect links. zicompinit is a function that just runs autoload compinit; compinit Apr 11, 2016 · Inside I've put: touch zshfl. To initialize the system, the function compinit should be in a directory mentioned in the fpath parameter, and should be autoloaded (‘ autoload -U compinit ’ is recommended), and then run simply as ‘ compinit ’. Ignore insecure directories and continue [y] or abort compinit [n]? If I say yes, it simply logs in, and my shell changes from bash to zsh. Aug 9, 2018 · Sorted. Nov 12, 2025 · compinit. 9 (x86_64-apple-darwin21. I've followed these steps: Cloned conda-zsh-completion: mkdir -p ~/zsh-plugins cd ~/zsh-plugins git clone https://gi May 7, 2020 · From macOS Catalina 10. 🐣 - Make Zsh compinit suck less. oh-my Dec 3, 2021 · I have errors with the zsh shell: zsh compinit: insecure directories and files, run compaudit for list the files listed with errors are /usr/local/share/zsh/site Hi everyone, With Bash, if I run docker images and double tab, I can see the list of images. dev Mirror of the Z shell source code repository. But once you do that, you may be much better off using a plugin built to do this. For example, when installing kind, I'm doing this: brew install kind kind complete zsh > ~/. It turns out this has caused some issues a Aug 13, 2025 · Saving settings Saving zsh settings Once we have customized zsh the way we like it, it is a good idea to save these options as the zsh defaults for the system. Ignore insecure directories and continue [y] or abort compinit [n]? So I'm now doing exec because I believie it ensures the previous environment doesn't pollute the May 16, 2018 · Update: June 2021 All the below still remains true, but a lot has happened in the world of Zsh performance over the last few years, in no small part due to Apple changing its default shell to zsh. For example, my system has two versions of zsh installed: Some zsh completion files for macOS specific commands and third party tools. I have a lot to learn about this shell, and so far, this is how I configured zsh There is an overload of snippets on-line, but I’ve not seen a post doing what I do, so hopefully this helps someone! Jul 31, 2020 · When I open a new terminal on Ubuntu under WSL2 I got: compinit:503: no such file or directory: /usr/share/zsh/vendor-completions/_docker Any ideias? May 25, 2016 · I have been using oh-my-zsh for a while now and the docker plugin as recently stopped working for me for some reason. bash >= v4) you should use the bash-completion@2 formula instead. I checked my ~/. Here’s how to fix it. zshrc and created a new one but the same issue occurs. If you'd prefer not to, use one of the solutions described above. e. Alternatively, we could make them the defaults for our account only be editing ~/. It includes 300+ plugins, themes, and tweaks to supercharge your terminal experience. This is unfortunate, as completions are absolutely necessary for me. Aug 14, 2019 · Maybe oh-my-zsh was loading outdated completions from its zcompdump and then I was running compinit manually with the default zcompdump to fix it Is there a standardized path where I should put completions so that they work both with and without oh-my-zsh? 19. zshrc, using gitfast (which is included in oh-my-zsh by default) that seems to (try to) load system bash-completion file, and zsh-bash-completions Apr 11, 2021 · Zerol_Yan的博客 1034 执行source ~/. zsh" file, then you're good. Handy features – Zsh comes packed with extra features like spelling correction, plugin support, and theming. The file specified does in fact exist. zshrc file) to enable Zsh's more advanced completion system. zshrc The reason for this is that my previous reload method (source) triggered a compinit error; zsh compinit: insecure directories, run compaudit for list. If you are running Arch Linux, you can install it using Pacman package manager. zshrc by adding it to your plugin list and reloading the completion: plugins=( zsh-completions) autoload -U compinit && compinit What does and reloading th Nov 27, 2024 · 当bar函数定义后,alias bar与bar函数共存: which bar 返回的是" alias bar=‘foo_copy_comp <一个或多个参数>’ " bar <TAB键> 会显示 foo <一个或多个参数> 命令之后的自动补全 运行 bar <其他参数> 命令,会执行 bar 函数,而非alias bar 配置示例 关闭全局的 compinit:在全局 zshrc 文件 ( mac: /etc/zshrc, linux: /etc/zsh/zshrc Jan 24, 2011 · ZSH takes about a second and a half from creating a new terminal window to being ready. With Zsh, there is no auto-completion at all. Jun 25, 2025 · BaseMax on Jun 25 Author compinit:527: no such file or directory: /usr/share/zsh/vendor-completions/_docker Oh My Zsh is a popular open-source Zsh configuration framework loved by developers worldwide. Homebrew’s package index Aug 6, 2017 · This post contains a short introduction to the zsh completion system, a full example that can be used as a starting point for new scripts, and some explanation of some of the more interesting parts of writing completion scripts. zshrc' autoload -Uz compinit compinit or Follow the instructions here If you are using oh-my-zsh, you may want to install and enable the zsh-autocomplete plugin. Just in case anyone found this not to work as expected. 6 a new completion system appeared which is supposed to do everything for you: you simply call a function, compinit, from an initialization file, after which zsh knows, for example, that gunzip should be followed by files ending in . 0) Any help is appreciated! Dec 9, 2023 · 网上许多 Zsh 的配置教程都是使用 oh-my-zsh 来进行配置, 优点是配置起来简单,对新手友好, 缺点是太过臃肿,拖慢 Zsh 的启动速度。这篇文章记录了我不使用 oh-my-zsh 从零开始配置 Zsh 的过程。 Zsh also ships with a tab-completion library for Git. zshrc to include autoload -Uz compinit and compinit so that completion is initialized for each instance of zsh. Table of contents Basics of zsh’s completion system Example completion script General structure The use of _arguments Resources Basics of zsh’s completion system Aug 17, 2025 · You complete me. If there's a "compinit being called at " message in the terminal, and it mentions Zim's "modules/completion/init. See the terminal emulator article for some general usage pointers. The third solution, and the solution that fixed the issue for me, is to initialise compinit with the -u flag. While being compatible with the POSIX sh (not by default, only if issuing emulate sh), it offers advantages such as improved tab completion and globbing. g. To use it, simply run autoload -Uz compinit && compinit in your . Oct 29, 2022 · I have basic command completions in Zsh without enabling the heavier duty compinit. zshrc to do that, and saved another 0. 25 seconds by removing the duplicate call! Zsh also ships with a tab-completion library for Git. In or If you are using Homebrew’s bash as your shell (i. zshrc file, to tell ZSH to not check for insecure directories. Ignore insecure directories and continue [ Feb 18, 2020 · I am using MacOS catalina for a while and always get this REALLY annoying message when I use sudo zsh zsh compinit: insecure directories and files, run compaudit for list. This has an advantage of getting updates for it automatically. # . Ignore insecure directories and files and continue [y] or abort compinit [n]? Nov 11, 2024 · 解决 Zsh compinit 不安全目录问题 在使用 Zsh 时,你可能会遇到以下错误提示: zsh compinit: insecure directories, run compaudit for list. Zim Framework: The Zsh configuration framework with blazing speed and modular extensions. I read through this gist and made the appropriate change, but the couple different versions of that hack don't make any difference. Ignore insecure directories and files and continue [y] or abort compinit [n]? When I run compinit audit it reveals the responsible directories: $ compaudit There are insecure directories and files: /nix/var/nix Feb 23, 2021 · When I open up terminal, the following message appears complete:13: command not found: compdef How can I fix it so that it disappears? STEPS TAKEN I have looked through similar questions posted on Aug 7, 2011 · It will modify your . Apr 17, 2021 · Not your script, but the user should call compinit (in their . zsh) and I'm trying to create a simple autocomplete function that describes each of its parameters. I have read the zsh documentation on completion which say's "alternatively, an explicit file name can be g Jul 18, 2024 · The actual output is much longer; I’ve just selected the portion I’m going to reference. 1 Use of compinit This section describes the use of compinit to initialize completion for the current session when run directly by the user; if you have run compinstall it will be called automatically from your . 1 Terminal emulator windows terminal If using WSL on Windows, which version of WSL WSL2 Additional context Jul 1, 2025 · Description After installing the latest version of docker desktop and starting a shell: zsh compinit: insecure files, run compaudit for list. I'm pretty sure that the culprit is compinit. See full list on thevaluable. 15 Catalina the default shell will be zsh. In zsh, the most basic completion is very straightforward: _complete_todos () { compadd help edit } autoload -Uz compinit compinit compdef _complete_todos todos The _complete_todos function is a Jul 9, 2019 · Apple has announced that in macOS 10. The slowest portion of my zshrc is the comp* functions, which initialize the Zsh completions system (see zshcompsys(1)). Mar 25, 2025 · This message appears when ZSH's completion system (compinit) detects files with permissions it considers insecure. Mar 5, 2025 · I'm trying to set up auto-completion for conda environment names in zsh on WSL. IRC: #pkg-zsh on OFTC The channel is bi-lingual English/German. My version: zsh 5. Upvoting indicates when questions and answers are useful. This guide will help you understand why this happens and provide multiple solutions to fix it permanently. As part of the migration, I copied over files including my Homebrew installation. This happened very randomly, but possibly after a recent oh-my-zsh update? Mar 2, 2016 · plugins+=(zsh-completions) autoload -U compinit && compinit zsh tab-completion system To enable the famous zsh tab-completion system, you need to add above commands ( autoload -U compinit && compinit). zcompdump file to see if it must be # regenerated adds a noticable delay to zsh startup. zsh # compinit optimization for oh-my-zsh # On slow systems, checking the cached . zcompdump to see if it needs regenerating. Contribute to zsh-users/zsh-completions development by creating an account on GitHub. Furthermore, if the subdirectory Base has a subdirectory named Core, compinit will add all subdirectories of the subdirectories is to the path: this allows the functions to be in the same format as in the zsh source distribution. The Zsh FAQ offers more reasons to use Zsh. The article below is still good for learning how to debug zsh extensions and plugins, but I'd try Oct 16, 2023 · What happens when you remove oh-my-zsh and instead just zsh -f and then autoload -U compinit and then compinit and then create the aliases? Jan 31, 2025 · Describe the bug I noticed my shell being slow starting up. Ignore insecure directories and continue [y] or abort compinit [n]? I can Jan 8, 2019 · From documentation: Enable it in your . Jun 26, 2017 · My oh-my-zsh install which has been working for almost a year has just broken. However, since _brew symbolic links have been removed from zsh-completions it just uses fpaths. Otherwise, remove the compinit call from the mentioned file: If you can edit the mentioned file, remove or comment the lines similar to these: Nov 9, 2018 · Zsh Compinit RTFM Slow start times in Zsh are probably a sign of poor configuration Originally published on November 9, 2018 Last updated on July 6, 2024 Filed under Technology May 21, 2023 · I'm trying to change the default location of the zsh completion cache files in macOS. Pull requests and contributions are welcome! Jan 23, 2022 · Describe the bug The message compinit:141: parse error: condition expected: $1 appears (twice) when starting a new shell. 2. Jan 14, 2019 · Ive been looking in all issues and no answer has solved my problem. 15. I saw an issue is the same as mine, but it doesn't work. oh-my-zsh/cache/ Jan 17, 2025 · Hi, i had to downgrade to ubuntu 22. The new system is based on shell functions, an added bonus since they are extremely Executing compinit -d dumpfile shaves maybe a second off the load time, but it doesn't stay that way. Configuring Completions in zsh To make Homebrew’s completions available in zsh, the Homebrew-managed zsh/site-functions path needs to be inserted into FPATH before initialising zsh ’s completion facility. This little hack restricts # it to once a day. After login, my shell changes to zsh. 04. What else is slow then? Turns out that compinit is ZSH checking the cached . 5 onwards, zsh is the default shell, instead of bash. However, the current completions are documented in the following man pages: zshcompsys zshcompwiz and the older completion approach was based on Jan 9, 2024 · Steps to reproduce run zsh on wsl2 with oh-my-zsh Expected behavior emmm,It should not occur the error, because I do noting for docker Screenshots and recordings OS / Linux distribution OS: Ubuntu 22. Ignore insecure directories and continue [y] or abort compinit [n]? Running the compaudit return Calling compinit with turbo mode If you load completions using wait'…' turbo mode then you can add atinit'zicompinit' to the syntax-highlighting plugin (which should be the last one loaded, as their (2 projects, zsh-syntax-highlighting & F-Sy-H) documentation state), or atload'zicompinit' to last completion-related plugin. Contribute to zdharma-continuum/zinit development by creating an account on GitHub. 133. However, the function compinstall can be run by a user to configure various aspects of the completion system. I haven't been able to find good documentation on compinit, bu Also, many other Homebrew packages use the same location for completion scripts, and the built-in zsh doesn’t know about those either. - zimfw/zimfw. A Custom Completion Script Your auto complete script needs to do two things: set up the completion system for your command using built-in scaffolding, and generate possible completions. Apr 28, 2017 · ksh(Korn Shell) はzshと同じくUnixコマンドの一つです。 kオプションもあり、ksh形式での読込を指定したい場合に使えます。 Dec 21, 2021 · If my startup shell is bash or tcsh and I start zsh, why do I get a message that is like: “/etc/zsh/zshrc:48: compinit: function definition file not found” Lmod supports both zsh and ksh. If you read more closely in that article, you actually need to run the compinstall shell command in addition to the autoload syntax. If you don't call compinit, you instead get Zsh's legacy completion system. their completions work while they didn't call compinit in their . Change the value for HISTFILE to set different location to store you zsh command history. I even deleted the . But wait! Look at the second column, the number of times each function was called. 3 LTS on Windows 10 x86_64 Kernel: 5. compinit automatically loads completions from zsh ’s fpath directories (see the “Autoloaded files” section of the zshcompsys manpage). 8. Also note that compinit is not required for getting completions in Zsh. What does it mean and how can I fix it? zsh compinit: insecure directories, run compaudit for list. gz. It should be pasted into your own completion file. plugin. Contribute to mattmc3/ez-compinit development by creating an account on GitHub. zshrc to change the location where compdump are stored. I've got a simple script file (example. Sep 20, 2021 · Because I can't seem to exit out of zsh compinit: insecure directories, run compaudit for list. when I run zsh I get the followeing errors: /etc/zsh/zshrc:111: compinit: function definition file not found /home/richard/. In this series, I will document my experiences moving bash settings, configurations, and scripts over to zsh. Mar 13, 2022 · I'm using zsh and oh my zsh, and I'm a bit confused about where to put completion files. From Homebrew, then you're done -- the Zsh completion script is already installed in $(brew --prefix)/share/zsh/site Additional completion definitions for Zsh. To take advantage of just completion in zsh in this scenario, you can set fpath to the Homebrew location before calling compinit. zshrc file and the plugin is included plugins=(git colored-man Apr 27, 2020 · The second solution is to set ZSH_DISABLE_COMPFIX=true (or "true" in quotes) in your . sh! I edited my ~/. Ignore insecure directori May 29, 2025 · I could avoid calling compinit twice by just modifying the fpath before sourcing oh-my-zsh. To initialize the system, the function compinit should be in a directory mentioned in the fpath parameter, and should be autoloaded (` autoload -U compinit ' is recommended Oct 30, 2023 · Here are some of the main benefits of using Zsh instead of Bash on your Mac: Powerful customization – Zsh offers many more customization options for your prompt, completion behavior, aliases, and key bindings. 1: What is completion? `Completion' is where you hit a particular command key (TAB is the standard one) and the shell tries to guess the word you are typing and finish it for you --- a godsend for long file names, in particular, but in zsh there are many, many more possibilities than that. Zsh’s interface is a bit more powerful than Bash’s: Zsh is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. # # The globbing is a little complicated here: Mar 23, 2024 · What happened? This error started printing twice each time I initiate a shell. Ignore insecure directories and continue [y] or abort compinit [n]? Aug 11, 2022 · Describe the bug Everytime I run the zsh command it will gives me the following error compinit:480: compdump: function definition file not found Steps to reproduce Sep 3, 2020 · I have tried with the latest version of my channel (Stable or Edge) I have uploaded Diagnostics Diagnostics ID: Expected behavior No issues with zsh completions and compinit when starting a new she Dec 11, 2017 · 25 . When I open a terminal, I get: instead of: source ~/. Steps to reproduce Honestly I have no clue. What's reputation and how do I get it? Instead, you can save this post to reference later. 4. zcompdump files are produced to speed up the running of compinit, Which initializes the shell completion in zsh. Using Plugins For an easy to use completions plugin I recommend ez-compinit. 1. Ignore insecure directories and continue [y] or abort compinit [n]? Oct 30, 2025 · zstyle :compinstall filename '/home/tradical/. compinit was called twice Mar 27, 2020 · zsh compinit: insecure directories, run compaudit for list. 1-microsoft-standard-WSL2 Zsh version 5. Contribute to zsh-users/zsh development by creating an account on GitHub. Oct 24, 2025 · zsh (Z sh ell) is an interactive login shell that can also be used as a powerful scripting language interpreter. Zsh’s interface is a bit more powerful than Bash’s: 13 hours ago · If you’re a macOS user running Zsh (the default shell since macOS Catalina), you’ve likely encountered the frustrating error: `zsh compinit: insecure directories, run compaudit for list. When I say ag Sep 22, 2024 · This happens when compinit detects that some directories in the autocompletion path are world-writable, which zsh considers a security risk. zshrc. You could specify an explicit dump file by compinit -d <dumpfile> in your . Additional completion definitions for Zsh. Ignore insecure files and continue [y] or abort compini Zsh's system has become more and more sophisticated, and in version 3. If I say no, it says that ncompinit: initialization aborted and logs in. Aug 2, 2017 · Password: zsh compinit: insecure directories, run compaudit for list. 3. zsh_plugins. It is similar to bash and the Korn shell, but offers extensive configurability, powerful command-line completion, file globbing, and spelling correction. zsh rc报错 503 compinit:503: no such file or directory: / usr / local / share / zsh / site-functions /_ brew compinit:503: no such file or directory: / usr / local / share / zsh / site-functions /_ brew _ cask compinit:503: no such file or directory: / usr / local / share / zsh / 系统级Zsh配置干扰:某些Linux发行版 (如Ubuntu)在系统级zshrc文件中主动调用compinit,与Zimfw的自动补全模块产生冲突。 第三方包管理问题:通过非官方渠道 (如AUR的zim-git包)安装Zimfw时,可能会引入额外的配置问题。 Aug 26, 2020 · That's why it has to fall back to the built-in completion at some point. Additionally, it should be called only once for each shell instance. 🌻 Flexible and fast ZSH plugin manager. Jan 25, 2017 · If the system was installed completely, it should be enough to call the shell function compinit from your initialization file; see the next section. It has also removed some other functionality because it was just duplicating what brew did. After debugging source files I found that the problem was in the oh my zsh source file and that the line that initializes the completion Jun 14, 2024 · I recently migrated from an Intel-based Macbook to an Arm-based Macbook. The simplest fix is to only do that once a day. One possible way to achieve this is to write our settings in the /etc/zsh/zshrc script. Part 1: Moving to zsh Part 2: Configuration Files Part 3: Shell Options Part 4: Aliases and Functions Part 5: Completions (this article) Part… Nov 27, 2024 · zsh compinit: insecure directories and files, run compaudit for list. That works just fine for me. txt - comments begin with "#" # Basic Zsh plugins are defined in user/repo format jeffreytse/zsh-vi-mode # Bash plugins may also work rupa/z # empty lines are skipped # annotations are also allowed: romkatv/zsh-bench kind:path olets/zsh-abbr kind:defer # set up Zsh completions with plugins mattmc3/ez-compinit zsh-users/zsh-completions kind:fpath path:src # frameworks like oh-my Apr 18, 2023 · The high line number is strange. zsh # On slow systems, checking the cached . Oct 2, 2024 · Restart your terminal. That's because the function is being called in /etc/zshrc. Jul 23, 2016 · When I run fakeroot in zsh it always gives me this warning: zsh compinit: insecure directories, run compaudit for list. Could it be that you have your own compinit function, which kind of dominates the builtin one? Does it give some insight when you do a whence -f compinit? Jul 21, 2022 · I tried majority of online solutions about bash-completion plus zsh issue, including defining autoload -U +X compinit && compinit and autoload -U +X bashcompinit && bashcompinit at the head of ~/. 5 and i am currently installing zsh and i also want to install some themes and so on, but after first downloading (sudo apt install zsh) i had this compinit e Mirror of the Z shell source code repository. Note also that Oh My Zsh runs compinit by default. # # The globbing is a little complicated compinit: Initializes the shell’s auto-completion functionality References These links proved themselves immensely helpful as I learned how to understand and configure this on my own: Git Completion Script in Zsh Zsh Completion System Zsh Styling Zsh Functions Using compinit Feb 1, 2025 · Super quick one I want to document here! I got myself on a side quest, again! No biggie, my ZSH shell was taking ages to load. It's simply required for activating Zsh's new completion system. Generating completions can make Zsh slow to open a new shell session, so if you want to get fancy and are worried about performance you could always use caching and compilation to speed things up. Unfortunately, you usually have to run compinit quite early, because so many things rely on it. chunul iku ljdtq mnvc znhbl qpwxxof aqndb qci ayzewk zoh rbr inzhuc bjltb rig nbkiy