Skip to content

docs: clarify auto-activation shell setup and directory-only scope - #153

Draft
smorin wants to merge 1 commit into
mainfrom
docs/directory-auto-activation
Draft

smorin wants to merge 1 commit into
mainfrom
docs/directory-auto-activation

Conversation

@smorin

@smorin smorin commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

The auto-activation guide currently presents eval "$(flox activate -D)" as shell-hook setup without explaining that it also activates the default environment in every new shell. A reader seeking directory-only activation can follow the guide and end up with an environment active outside its directory.

This change separates shell integration from directory permission, states the startup command's always-on effect, and documents the public-initializer gap in Flox 1.19.4. It also adds an explicit directory allow example and uses the canonical allowlist spelling. allowed remains an accepted compatibility alias; this is not a broken-command fix.

Verification

  • Refreshed flox/docs against origin/main before analysis (base 73a04f8).
  • Checked the installed Flox 1.19.4 command help, packaged man pages, and release-tag implementation (v1.19.4, 45038aa8eb7c84ccb678fc5f67e829b3867f66b3).
  • An isolated Zsh test using the exact shipped native hook registration passed: no active environment before entry, activation in an allowed directory and its descendants, no change from a forked directory change, and no active environment after exit. No default environment, direnv integration, packages, or user configuration changes were involved.
  • git diff --check, Bash syntax checks for all eight Bash examples, eight internal-link checks, and MDX component-balance checks passed.
  • Mintlify and Vale were not run because those tools are not installed in this checkout's available environment. No dependencies were installed.

Recommendation for the shell integration

The native directory-only engine is shipped. The public standalone initializer is missing: hook registration is currently emitted by activation, while hook-env is explicitly an internal interface. Expose the existing shell-hook generator through a supported public command, for example a future flox hook zsh, and then document its eval as the directory-only setup. This proposed command does not currently exist, and this PR does not document it as shipped or publish the internal registration snippet as a supported API.

Implementation references: native Zsh hook, hook registration during activation, internal command classification.

@mintlify

mintlify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
flox 🟢 Ready View Preview Nov 11, 2026, 11:59 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the documentation update clarifying Flox auto-activation behavior.

No open issues 🎉

What changed in this PR

Clarifies the distinction between shell integration and directory permission in Flox auto-activation, helping readers avoid unintentionally activating the default environment in every shell.

Changes:

  • Explains that the startup commands install the prompt hook and keep the default environment active outside allowed directories.
  • Documents the absence of a public hook-only initializer in Flox 1.19.4.
  • Uses the canonical allowlist spelling and adds an explicit directory-permission example.

Review was limited to the supplied diff; no automated checks were run.

File Description
concepts/​auto-activation.mdx Clarifies startup behavior, directory-only limitations, and permission setup.

Review effort: Balanced

@smorin
smorin marked this pull request as draft November 12, 2026 00:13
@smorin smorin assigned smorin and unassigned justincastilla Nov 12, 2026

This branch was successfully deployed

1 active deployment
staging — d91d5eed Deployed Nov 11, 2026 by mintlify[bot]
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.

3 participants