warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
20.86k stars 355 forks source link

$BASH hardcoded to `/bin/bash` when it should be `/opt/homebrew/bin/bash` #3624

Open luckman212 opened 1 year ago

luckman212 commented 1 year ago

Describe the bug

set shell to Bash (Custom) - /opt/homebrew/bin/bash

start Warp

run these cmds...

$ echo $BASH
/bin/bash
$ echo $BASH_VERSION
5.2.15(1)-release
$ /bin/bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)
Copyright (C) 2007 Free Software Foundation, Inc.

something is off... ? Does not happen in iTerm2 or Terminal.

Expected behavior

$ echo $BASH
/opt/homebrew/bin/bash

Screenshots

image

Operating system

MacOS

Operating system and version

13.5.1

Shell Version

5.2.15(1)

Current Warp version

v0.2023.08.29.08.04.stable_00

Regression

No, this bug or issue has existed throughout my experience using Warp

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

aremmell commented 1 year ago

command -v bash or which bash will tell you which binary is being found first in your $PATH. It could be that your path is out of order, and it's finding /bin/bash first.

luckman212 commented 1 year ago

Not sure how this is possible then- which and command -v both point to the Homebrew version, which is 5.x, and the PATH lists /opt/homebrew/* before /bin...

screenshot_3oebhmHI
elviskahoro commented 12 months ago

@luckman212 This happens for iTerm and Mac terminal as well?

Is the variable that you meant to use: $SHELL or $0

luckman212 commented 12 months ago

No, I am not trying to use $0 or $SHELL

Here is iTerm:

image

and Terminal:

image

and again, Warp:

image

This is now Warp v0.2023.09.06.18.09.stable_00

elviskahoro commented 12 months ago

@luckman212 thanks for this!

hclihn commented 2 months ago

I have the same issue, too. This prevents me from using newer features of bash like mapfile. Terminal and iTerm2 don't have this issue.

In Warp:

$ type mapfile
bash: type: mapfile: not found
$ echo $BASH
/bin/bash
$ declare -p BASH_VERSION
declare -- BASH_VERSION="3.2.57(1)-release"
$ echo $BASH_VERSION
3.2.57(1)-release

In iTerm2 and Terminal:

$ type mapfile
mapfile is a shell builtin
$ echo $BASH
/opt/homebrew/bin/bash
$ declare -p BASH_VERSION
declare -- BASH_VERSION="5.2.15(1)-release"
$ echo $BASH_VERSION
5.2.15(1)-release

Can we have this bug fixed? It's very annoying.