zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.28k stars 2.73k forks source link

Support user's default shell #5320

Open gaetgu opened 2 years ago

gaetgu commented 2 years ago

When I open up the terminal, it uses zsh (macOS's default), but I have set the default to fish. This isn't that big of a deal, but I would really love it if the terminal used my default (fish) instead of mac's default (zsh).

Environment: Zed 0.44.1 – /Applications/Zed.app macOS 13.0 architecture arm64

mikayla-maki commented 2 years ago

Fixed, will be in the next release!

ghost commented 1 year ago

Fixed, will be in the next release! @mikayla-maki

I still have this problem on Zed 0.79.1

mikayla-maki commented 1 year ago

Can you tell me more about your problem senevr? I just went through the code paths and we should check $SHELL and then /etc/passwd :)

ghost commented 1 year ago

@mikayla-maki

I'm not very technically experienced with these type of stuff so apologies if it turns out to be a simple mistake;

I'm on Air M1 macOS Ventura 13.3 and I recently switched from using ZSH to Fish, here are the two commands I ran in order to make Fish the default shell on my system: sudo bash -c 'echo $(which fish) >> /etc/shells' chsh -s $(which fish) I got it from https://gist.github.com/idleberg/9c7aaa3abedc58694df5

echo $SHELL outputs /opt/homebrew/bin/fish and everything works fine except with Zed. Tried restarting Zed and my computer but no luck, it just keeps defaulting to ZSH, i tried overriding the terminal option in settings to use "system" for shell but got no luck with that either. I don't know what else to tell you so if you need to know something else then let me know 👍

mikayla-maki commented 1 year ago

Ahh, I can reproduce the issue now. Thank you! :D

mikayla-maki commented 1 year ago

When using fish via the recommended fish installation method, it changes the $SHELL. For some reason, we don't have $SHELL in the Zed process environment. Have not dug further.

joefitzgerald commented 8 months ago

I cannot seem to reproduce this issue, and I use fish / MacOS.

snokpok commented 7 months ago

can reproduce the issue for me; have both zsh and fish on my Mac

jasongitmail commented 4 months ago

I experienced something related that might help others encountering this Github Issue.

Problem For Zed's integrated terminal, which fish would return /usr/local/bin/fish (undesired). But every other terminal on my system, which fish returns /opt/homebrew/bin/fish. This resulted in Zed's terminal having an older NodeJS version, among other things.

Solution My fish config contained eval (/opt/homebrew/bin/brew shellenv), which has always been sufficient to set up Homebrew for my system previously. But for Zed's integrated terminal, I had to also add set -gx PATH /opt/homebrew/bin $PATH below that line in my Fish config. With it, Zed's integrated terminal returns /opt/homebrew/bin/fish for which fish and all works as expected.

(M1 series Mac, Zed 0.133.7, Homebrew 4.2.20, Fish 3.7.1)

jerrygreen commented 4 months ago

I use nushell as my default shell, it works without an issue. So there’s such a feature, and it is working. And I didn’t have to include any workarounds like set -gx something. That’s weird.

By the way, if you like fish, you will probably love nushell, have a try it’s really great