Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not start a login shell #2

Closed
StrangeNoises opened this issue Jun 30, 2017 · 13 comments
Closed

does not start a login shell #2

StrangeNoises opened this issue Jun 30, 2017 · 13 comments

Comments

@StrangeNoises
Copy link

Encouraging start. I'm trying it out on macOS Sierra btw. So far the main problem I have is that it does not start a login shell, so files such as ~/.bash_profile don't get sourced. I could understand if people wanted this only as an option, but... then we do need that option. "Run as a login shell" :)

Relatedly it defaulted to /bin/zsh instead of my actual configured shell. That for what it's worth, is /usr/local/bin/bash, as installed by Homebrew, being a lot newer than the one in macOS. In case that might have confused it.

To compare with macOS Terminal.app, both the above would be covered by the "Shells open with" option in its General tab: "Default login shell". It also has an option to specify a command to open the shell with, which seems like it might be a good idea too.

@StrangeNoises
Copy link
Author

Half fixed. It As of alpha 15 it still isn't picking up the correct user's shell. For me it started up by default in /bin/sh and did not run my profile. However when I manually selected my actual shell /usr/local/bin/bash it did run the profile. The profile is in ~/.bash_profile so that may actually be appropriate (even though bin/sh is bash in reality). So the error is in not discovering my actual default shell.

/usr/local/bin/bash is in my /etc/shells, and as such is correctly listed in the list of shells in Settings, but despite being my default (as selected earlier using chsh) that isn't being picked up.

NB: Now running in High Sierra beta 1, but that seems to not be presenting any differences.

@Eugeny
Copy link
Owner

Eugeny commented Jul 5, 2017

Have you upgraded with the config in place? If so, your previous shell choice will be used. There's a new "Default shell" option in the shell list, which is default for new installations, and will pick the shell from your /etc/passwd entry.

@StrangeNoises
Copy link
Author

no, the high sierra upgrade on this machine failed so i ended up with a completely fresh installation. Since then I only just now installed terminus afresh to test this stuff since receiving an email notification (actually about the npm-discovery issue, related but this response was a bit off-topic to that hence putting it here).

I'm only now installing npm on this machine so will see in a bit (waiting for node to compile) about that specifically.

Right, /etc/passwd is, I think, not where you look for a user's default shell on macOS. I'd better power up my remaining Sierra machine in a bit to see if that's a change in High Sierra. But grep rachel /etc/passwd is not returning anything.

Little bit of googling, it appears this command can retrieve a user's shell:

(stand by, just realised splat-C for copy doesn't work, subject for another Issue if no-one else has already reported it...)

$ dscl localhost -read /Local/Default/Users/$USER shell
dsAttrTypeNative:shell: /usr/local/bin/bash

Confirmed, this is not new in High Sierra, but all applies in Sierra too.

@StrangeNoises
Copy link
Author

NB: Discovered the dscl command via here: https://superuser.com/questions/379725/how-do-i-change-a-users-default-shell-in-osx#379726 discovered for myself sudo not needed just to read one's own settings.

@Eugeny
Copy link
Owner

Eugeny commented Jul 5, 2017

Quite strange, I was testing it on my Sierra mac. I'm actually using dscl on macOS, /etc/passwd was just a brain fart :)
For some reason, your dscl output format is different - I'll check with a couple of other just Macs to be sure.

I'm tracking the Cmd-C issue in #61

@Eugeny Eugeny reopened this Jul 5, 2017
@StrangeNoises
Copy link
Author

curiouser and curiouser.

In checking something else I just tried setting the shell option back to "Default shell" and... now it's working. Beginning to think it was only not working on a completely fresh install, first-start... except it is now also working after I delete all terminus config I know about (~/Library/Application Support/terminus, ~/Library/Preferences/org.terminus*) and start up again.

BTW still not detecting npm. Can confirm homebrew npm is installed, in a path set up in /etc/paths, and thus read by /etc/profile and definitely in the $PATH visible to a default shell - now, as per the above. But that probably belongs in #4.

@Eugeny
Copy link
Owner

Eugeny commented Jul 5, 2017

Can you please check the process' PATH by going into Settings > Open dev tools > Console and typing process.env.PATH? Thanks.

@Eugeny Eugeny closed this as completed in c0c2373 Jul 5, 2017
@StrangeNoises
Copy link
Author

Result: "/usr/bin:/bin:/usr/sbin:/sbin"

@StrangeNoises
Copy link
Author

didja really mean to close it?

@Eugeny
Copy link
Owner

Eugeny commented Jul 5, 2017

Duh, this has completely slipped my mind - the app itself doesn't receive the $PATH from profile - only the one from launchd: https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications

Can you check whether env -i bash -c -l "echo $PATH" contains your npm's path?

@StrangeNoises
Copy link
Author

it does.

@Eugeny
Copy link
Owner

Eugeny commented Jul 5, 2017

Hopefully this one will fix this once and for all

@StrangeNoises
Copy link
Author

Apparently not, as of Alpha 18. process.env.PATH still "/usr/bin:/bin:/usr/sbin:/sbin".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants