hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Hyper doesn't use default shell on MacOS

Open kevtan opened this issue 4 years ago • 11 comments

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: macOS Catalina (10.15.3)
  • Hyper.app version: 3.0.2
  • Link of a Gist with the contents of your .hyper.js: https://gist.github.com/kevtan/676534f30a79f7d816254b7af515aefe
  • Relevant information from devtools (CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere): N/A
  • The issue is reproducible in vanilla Hyper.app: Is Vanilla

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!

kevtan avatar Feb 17 '20 03:02 kevtan

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

LabhanshAgrawal avatar Feb 17 '20 09:02 LabhanshAgrawal

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!

  • default-shell version 1.0.1
  • node version 12.6.0

kevtan avatar Feb 17 '20 18:02 kevtan

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 avatar Feb 17 '20 18:02 LabhanshAgrawal

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

LabhanshAgrawal avatar Feb 17 '20 18:02 LabhanshAgrawal

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!

kevtan avatar Feb 17 '20 21:02 kevtan

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

LabhanshAgrawal avatar Feb 17 '20 21:02 LabhanshAgrawal

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

bhardy avatar Mar 03 '20 22:03 bhardy

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.)

hannesmeinlschmidt avatar Mar 13 '20 19:03 hannesmeinlschmidt

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.

alasher avatar Jul 30 '20 00:07 alasher

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

Liverrrrr avatar Nov 17 '21 02:11 Liverrrrr

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.

mash808 avatar Jul 24 '22 04:07 mash808