Skip to content

DOTFI-25: Enable zsh-completions via omnishell - #39

Merged
JtheGunner merged 3 commits into
mainfrom
chore/DOTFI-25-enable-zsh-completions-via-omnishell
Nov 28, 2026
Merged

JtheGunner merged 3 commits into
mainfrom
chore/DOTFI-25-enable-zsh-completions-via-omnishell

Conversation

@JtheGunner

Copy link
Copy Markdown
Owner

YouTrack: https://youtrack.xn--wrm-hoa.li/issue/DOTFI-25

Enable the omnishell zsh-completions module (omnishell 0.9.0) and have the bootstrap fix the Homebrew directory permissions that zsh's compinit rejects.

Changes

  • omnishell/config.toml: enable [modules.zsh-completions]; OMNISHELL_MIN_VERSION is now 0.9.0.
  • New bootstrap step fix_completion_permissions (before apply_omnishell): chmod go-w on share and share/zsh (recursively, directories only) when they are group- or world-writable. It runs only with Homebrew, only while the module is on, and only for directories the user owns; others are reported with a quoted sudo chmod command. A second run changes nothing.
  • New setting [bootstrap] fix_completion_permissions (default true) and DOTFILES_FIX_COMPLETION_PERMISSIONS to switch the step off.
  • README, config.toml.example and the settings schema updated.

Test plan

  • Ran every tests/test-*.sh individually: all pass (tests/bootstrap-smoke.sh left to CI).
  • New checks in tests/test-optional-parts.sh: permissions fixed, idempotent, outside directories untouched, file/environment switch, invalid value, module off, no Homebrew, foreign owner, unusual directory name, config enables the module.
  • Reviewer: run ./bootstrap.sh on a Homebrew machine with a group-writable /opt/homebrew/share and open a new zsh; no "insecure directories" warning should appear.

…are permissions

Turn on [modules.zsh-completions] (omnishell 0.9.0, put on fpath before compinit)
and raise OMNISHELL_MIN_VERSION to 0.9.0.

compinit rejects completion directories that group or others can write to, and
Homebrew's share/ and share/zsh/ are group-writable on some installs. A new
bootstrap step drops the group/other write bit there, only on Homebrew, only for
directories the user owns and only while the module is on; other directories are
reported with the command to run. The step is switched off with
fix_completion_permissions = false or DOTFILES_FIX_COMPLETION_PERMISSIONS=0.
The path comes from find, so it is data. Print it with printf %q so the
suggested command stays one safe line, and test an unusual directory name.
Also assert that omnishell/config.toml enables the zsh-completions module.
GNU stat treats -f as filesystem status and exits 0, so the BSD form returned
garbage on Linux and every permission check failed in CI. Try -c first, which
BSD stat rejects, then fall back to -f.
@JtheGunner
JtheGunner merged commit db52dc2 into main Nov 28, 2026
5 checks passed
@JtheGunner
JtheGunner deleted the chore/DOTFI-25-enable-zsh-completions-via-omnishell branch November 28, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant