Skip to content

Conversation

@hosni
Copy link

@hosni hosni commented Dec 20, 2025

Laravel Sail currently hardcodes bash as the shell used when running sail shell and sail bash. This limits developers who prefer a different shell such as zsh, or who configure a non-bash default shell inside their application container.

Many developers use zsh as 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 shell and sail bash currently 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 to bash)
  • Updated shell-related commands:

    • sail shell now starts the container using $APP_SHELL
    • sail bash always starts bash
    • sail root-shell uses $APP_SHELL as root
    • sail root-bash always starts bash as root
  • Updated the CLI help output to clearly describe each command instead of treating bash commands as aliases.

Backward compatibility

  • Fully backward compatible.
  • When APP_SHELL is not set, it defaults to bash, preserving the current behavior.
  • Existing scripts and workflows using sail shell or sail bash continue to work as before.

Example usage

export APP_SHELL=zsh
sail shell

This will start a zsh session inside the application container, assuming the shell is available.

@hosni hosni changed the title Introduce APP_SHELL env to use custom shell (like zsh) for "sail shel… Introduce APP_SHELL env to use custom shell (like zsh) for "sail shell" command Dec 20, 2025
@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

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.

2 participants