vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.27k stars 3.52k forks source link

Hyper doesn't use default shell on MacOS #4266

Open kevtan opened 4 years ago

kevtan commented 4 years ago

Issue

Right out of the box, on macOS, Hyper still uses bash instead of the system default (which is now zsh). This causes the following annoying message to appear:

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

Running the suggested command chsh -s /bin/zsh does nothing because it just changes the default system shell... which is already zsh! The issue is that Hyper is launching the bash shell by default, even though this isn't the system default. It can be easily fixed by changing the shell field in .hyper.js to be "/bin/zsh" but it would be nice if this worked out of the box!

LabhanshAgrawal commented 4 years ago

We use default-shell to get the default shell. I'm getting zsh without setting shell in config I'm using latest ci build, you can try it from here

kevtan commented 4 years ago

I just installed the default-shell npm module in a standalone project directory and tried to see what its default shell is and I'm still getting /bin/bash!

LabhanshAgrawal commented 4 years ago

Hmm that's strange, I tried the same (default-shell separately) and I'm getting zsh, even when I start node from bash. Can you try the steps from here (Do the From System Preferences step & just check your current login shell)

LabhanshAgrawal commented 4 years ago

Also, which shell opens when you start the default Terminal.app?

kevtan commented 4 years ago

zsh opens in my default terminal app. It's weird that the same issue isn't able to be replicated on your machine—it's a minor issue though; I'm not sure how much it's worth looking into from a contributor!

LabhanshAgrawal commented 4 years ago

did you try the ci build? If yes, then can't think of anything else (without debugging) which might be causing this.

bhardy commented 4 years ago

I'm having the same issue on a fresh install. echo $0 and echo $SHELL both return bash in Hyper, while returning zsh in terminal. switching the default shell back and forth works but only terminal reflects the change. I manually put zsh in as my shell in my hyper config and it's working fine (although it's printing a % on the first line for some reason). I suspect hyper isn't honouring the system shell.

update: I tried the canary build and the behaviour is exactly the same

hannesmeinlschmidt commented 4 years ago

I also have this problem on a fresh install, switching between bash and zsh works perfectly fine in the terminal app, no change in behavior in hyper though. (I also get the "%" in the first line of hyper when changing to /bin/zsh manually. Interestingly, echo $0 does not indicate that zsh or bash run as login shells although shellArgs is set accordingly.)

alasher commented 4 years ago

Just to update anyone else who reads this, I had the same issue described above where $SHELL was correctly set to /bin/zsh on Terminal.app, but was still using /bin/bash on Hyper. For me it was fixed after fully logging out and back in again, simply opening a new terminal session did not work. I guess it could just be a bug with chsh.

Liverrrrr commented 2 years ago

In the words of my school IT director, "did you doa restart?"

mash808 commented 2 years ago

Just to update anyone else who reads this, I had the same issue described above where $SHELL was correctly set to /bin/zsh on Terminal.app, but was still using /bin/bash on Hyper. For me it was fixed after fully logging out and back in again, simply opening a new terminal session did not work. I guess it could just be a bug with chsh.

Thanks for the tip! This has been slightly annoying me since I bought my Mac, but your suggestion worked right away. Cheers.