mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Fix for #6299: restore previous default shell with uninstall
This commit is contained in:
parent
accdcb2f1c
commit
17b86257da
2 changed files with 7 additions and 0 deletions
|
|
@ -85,6 +85,7 @@ main() {
|
|||
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
|
||||
# If this platform provides a "chsh" command (not Cygwin), do it, man!
|
||||
if hash chsh >/dev/null 2>&1; then
|
||||
echo $SHELL > ~/.default-shell.pre-oh-my-zsh
|
||||
printf "${BLUE}Time to change your default shell to zsh!${NORMAL}\n"
|
||||
chsh -s $(grep /zsh$ /etc/shells | tail -1)
|
||||
# Else, suggest the user do so manually.
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]; then
|
|||
|
||||
mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
|
||||
|
||||
if [ -f ~/.default-shell.pre-oh-my-zsh ] && hash chsh >/dev/null 2>&1; then
|
||||
previous=$(cat ~/.default-shell.pre-oh-my-zsh)
|
||||
echo "Switching your shell back to $previous"
|
||||
chsh -s $previous
|
||||
fi
|
||||
|
||||
echo "Your original zsh config was restored. Please restart your session."
|
||||
else
|
||||
if hash chsh >/dev/null 2>&1; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue