Skip to content

fix: use login shell for PATH configuration in install script#4457

Merged
laithrw merged 3 commits into
browser-use:mainfrom
techiro:fix/install-shell-detection
Mar 25, 2026
Merged

fix: use login shell for PATH configuration in install script#4457
laithrw merged 3 commits into
browser-use:mainfrom
techiro:fix/install-shell-detection

Conversation

@techiro
Copy link
Copy Markdown
Contributor

@techiro techiro commented Mar 22, 2026

Summary

  • Fix install script writing PATH to ~/.bashrc instead of ~/.zshrc for zsh users
  • Use $SHELL (user's login shell) instead of $BASH_VERSION/$ZSH_VERSION (running shell) for shell detection
  • When executed via curl ... | bash, the script always runs in bash, so $BASH_VERSION is always set regardless of the user's actual shell

Changes

  • configure_path(): Replace $BASH_VERSION/$ZSH_VERSION check with $(basename "$SHELL")
  • print_next_steps(): Same fix for the shell RC file displayed in completion message

This could be considered as a follow-up improvement if the maintainers prefer.

Fixes #4440

When the install script is executed via `curl ... | bash`, it always
runs in a bash process, so $BASH_VERSION is always set regardless of
the user's actual shell. This causes PATH to be written to ~/.bashrc
even for zsh users, making the `browser-use` command unavailable.

Use $SHELL (the user's login shell) instead of $BASH_VERSION/$ZSH_VERSION
to detect the correct shell RC file.

Fixes browser-use#4440
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 22, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="browser_use/skill_cli/install.sh">

<violation number="1" location="browser_use/skill_cli/install.sh:458">
P2: Post-install source instructions are inconsistent with PATH file selection for non-bash/zsh shells.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread browser_use/skill_cli/install.sh Outdated
Ensure print_next_steps() falls back to .profile for non-bash/zsh
shells, matching the behavior of configure_path().
@techiro techiro marked this pull request as draft March 22, 2026 06:03
@techiro techiro marked this pull request as ready for review March 22, 2026 06:13
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@laithrw laithrw merged commit e9d2e91 into browser-use:main Mar 25, 2026
88 checks passed
@techiro techiro deleted the fix/install-shell-detection branch March 28, 2026 11:35
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.

Bug: zsh: command not found: browser-use

3 participants