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

Issue wish oh my zsh newuser-install #795

Closed
cummingsk05 opened this issue Aug 6, 2016 · 5 comments
Closed

Issue wish oh my zsh newuser-install #795

cummingsk05 opened this issue Aug 6, 2016 · 5 comments

Comments

@cummingsk05
Copy link

cummingsk05 commented Aug 6, 2016

I am trying to get oh my zsh to work with bashonwindows, but when I open a window and press '2' for the new user configuration I am met with this error.

image

This should allow me to enter into a zsh prompt, but I can't go any further.

Build 14393.10

@rodrymbo
Copy link

rodrymbo commented Aug 6, 2016

It'd be interesting to know where you got zsh... did you get a package somewhere, or compile it yourself, or use apt-get install, or ... ?

It'd also be interesting to see what the permissions on .zshrc are, or even if it exists. Can you edit it manually, for example, perhaps with nano? Is it perhaps writable only by root or something weird like that?

That looks like an error coming from cp. You could test it by using cp from the command line to copy something to .zshrc. Perhaps what you have found is a problem in cp.

@cummingsk05
Copy link
Author

@rodrymbo I installed it using apt-get install. As for the .zshrc file, it looks to be read only. I changed permissions and it was still the same. Funny enough, when prompted with the same error again, i typed in bash to get back to the bash shell and it ended up working. I have no idea why that would have done it.

@fpqc
Copy link

fpqc commented Aug 6, 2016

cummingsk05, works here if you install oh-my-zsh from github no problems =]

@neurogenesis
Copy link

A few notes for people running zsh:

  1. Install zsh with sudo apt-get install zsh

  2. bash.exe is the entrypoint to the WSL / linux subsystem. You'll have to modify the windows shortcut to specify bash -c --login or modify ~/.bashrc with exec /bin/zsh to properly load a different shell. /etc/passwd isn't consulted because it's not a full login process. Be sure to set your SHELL env var as well. See Can't change default shell #846 for details.

  3. Fix your umask before you start installing things, otherwise tools like zsh will complain. Specifically, "group" and "other" permissions will have the same privileges that owner do. This causes zsh's compaudit and compinit to fail (both are related to command completion). See Default umask (permissions) is not applied #352 for details. umask 022 can be added to your ~/.bashrc.

NOTE: This should be done before trying to install zsh plugin managers like antigen (otherwise the directory/file permissions issues from git clones). You should also do this before installing RVM or rbenv.

I ended up inserting a few lines to the top of my ~/.bashrc, something like the following:

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

## Fix missing umask value
umask 022

## Launch Zsh
if [ -t 1 ]; then
  cd $HOME
  export SHELL=/bin/zsh
  exec -cl $SHELL
fi

@tara-raj
Copy link

Closing as this now works. Issue resolved

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

5 participants