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

Missing chsh for zsh / oh my zsh install #10

Open
johnlauck opened this issue Feb 17, 2015 · 8 comments
Open

Missing chsh for zsh / oh my zsh install #10

johnlauck opened this issue Feb 17, 2015 · 8 comments

Comments

@johnlauck
Copy link

I might be missing something but there's no call to change the user shell to zsh so oh my zsh is pulled down but not actually made usable. Anyone else have a similar experience?

@ninjabong
Copy link
Member

I'm still a bash user, but the project's originator is the one who made the default starter, including the zsh bits.

I can think of a few ways to add setting a user's shell for zsh (or ksh or whatever), simplest being appending /bin/zsh to a .profile (easier to back out of), or going full out and forcing the shell into Directory Services with dscl (and potentially leaving users confused as it's not as simple as the early OS X and you can change your shell from the System Preferences GUI).

Before I try and put something together I'm curious how you, as a zsh user, are currently setting your own shell?

@johnlauck
Copy link
Author

The oh-my-zsh manual installation includes a step to call chsh -s /usr/local/bin/zsh. I'm not sure that fixes it entirely. As an alternative the shell can be set directly in iTerm2 or Terminal. I have yet to successfully work either solution into Ansible.

Ideally, should the zsh piece be an external role?

@ninjabong
Copy link
Member

Yeah that's what I'm thinking, an additional role in starter named like setshell that can do the work.

Not sure about iTerm2's settings but I'm guessing it's similar to manipulating other OS X plist preferences. For Terminal.app it should just be as simple as using defaults to write the new preference value:
command: "/usr/bin/defaults write ~/Library/Preferences/com.apple.Terminal Shell /usr/local/bin/zsh"
which is the equivalent of the GUI's Startup Preference for "Shells open with" and should correctly source zsh's dotfiles.

I'll have some time later tonight to whip something up and test out in a VM for both iTerm2 and Terminal.

@ninjabong
Copy link
Member

So I played around with things, and Terminal.app was simple to implement. But after failing to be able to manipulate keys inside an array for iTerm2.app prefs I said "this is stupid" and realized it'd be a lot more useful to just bulk replace iTerm2's settings with a pre-made / already configured plist in the dotfiles, and just copy that into place.

So I wound up with this - https://github.com/ninjabong/starter/tree/master/roles/setshell
(and tasks/main.yml has some commented out bits about doing it with defaults and dscl)

And realized I was just reimplementing parts of an older role I had made for what's now osxc-legacy to setup Terminal.app to my liking - https://github.com/ninjabong/xc-custom/tree/master/roles/terminal_prefs

Now I'm thinking I'll just update the old terminal_prefs role, adding support for iTerm2 and talk to @rricard about how best to integrate it with starter.

@rricard
Copy link
Contributor

rricard commented Feb 18, 2015

I had many issues with chsh in ansible. For now it is still a manual operation

@ninjabong
Copy link
Member

@rricard oh hrmm, how about just adding a minimally modified iterm2.plist to dotfiles and add it to the post_tasks in configuration.yml?

@rricard
Copy link
Contributor

rricard commented Feb 18, 2015

Not a big fan of this solution. Seems to be overkill just to switch shell.

On Wed, Feb 18, 2015, 08:22 ninjabong [email protected] wrote:

@rricard https://github.com/rricard oh hrmm, how about just adding a
minimally modified iterm2.plist to dotfiles and add it to the post_tasks in
configuration.yml
https://github.com/osxc/starter/blob/master/configuration.yml?


Reply to this email directly or view it on GitHub
#10 (comment).

@ninjabong
Copy link
Member

Kinda overkill yeah, but it'd just be another file in dotfiles/ and shows users they can customize things by using plist prefs there.

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

No branches or pull requests

3 participants