How to set zsh as default shell? (original) (raw)
September 22, 2024, 8:05am 1
Hi,
I have added this in my postBuild file
# Install Zsh and Oh My Zsh
apt-get update && apt-get install --yes zsh
# Install Oh My Zsh silently
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Optional: install plugins for Oh My Zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Enable plugins in the .zshrc file
sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions)/' ~/.zshrc
How to set zsh as default shell, without running zsh
in the default terminal?
Thank you
manics September 23, 2024, 1:18pm 2
What have you tried so far? Can you share a link to your repository? postBuild
runs as an unprivileged user, so this script won’t have installed zsh.
aborruso September 23, 2024, 1:32pm 3
I have no problem, the postbuild install it and I run zsh
and I have it.
I wanted to know if there was a way to apply it without writing it down.
The repo is this GitHub - aborruso/my-binder
Thank you
manics September 23, 2024, 1:49pm 4
Sorry, I don’t understand what you mean by “without writing it down”.
Note it’s best practice to include set -e
at the start of your script file, otherwise any errors whilst running the script will be silently ignored.
aborruso September 23, 2024, 2:03pm 5
Yes thank you, I will add -e
.
But I think I do not have any error. My question is: I don’t have to add anything to say that zsh should be the default one?
Thank you
And I confirm that it works without any error.
But I wanted to know if there was a way to make it the default one.
manics September 23, 2024, 3:36pm 7
aborruso September 24, 2024, 6:23am 8
It gives me 1
error.
It probably cannot be done, I give up. I will write zsh
myself in the termnal.