Introduce APP_SHELL env to use custom shell (like zsh) for "sail shell" command #841
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Laravel Sail currently hardcodes
bashas the shell used when runningsail shellandsail bash. This limits developers who prefer a different shell such aszsh, or who configure a non-bash default shell inside their application container.Many developers use
zshas their primary shell due to its ecosystem of plugins and themes, commonly through frameworks such as Oh My Zsh, which provide productivity features like better auto-completion, prompts, and tooling integration.Additionally,
sail shellandsail bashcurrently behave identically, which makes it difficult to distinguish between a configurable default shell and an explicit Bash session.Sail already relies on environment-driven configuration, so allowing the default shell to be configured aligns well with its design philosophy.
What changed
Added a new environment variable:
APP_SHELL(defaults tobash)Updated shell-related commands:
sail shellnow starts the container using$APP_SHELLsail bashalways startsbashsail root-shelluses$APP_SHELLas rootsail root-bashalways startsbashas rootUpdated the CLI help output to clearly describe each command instead of treating
bashcommands as aliases.Backward compatibility
APP_SHELLis not set, it defaults tobash, preserving the current behavior.sail shellorsail bashcontinue to work as before.Example usage
export APP_SHELL=zsh sail shellThis will start a
zshsession inside the application container, assuming the shell is available.