Reset Zsh config?

Yesterday I installed Zsh, and tried to configure some things, but somehow everything is messed up. A lot of commands do not work, I've done PROMPT in ~/.zshrc but it does not work correctly either.

For example when I am trying to search for something:enter image description here

Now as you can see I also don't have the prompt name even though I added the PROMPT="...." configuration in the ~/.zshrc file.

Is it possible to somehow reset the whole configuration?

zsh echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/mosquito/HP_Fortify/HP_Fortify_SCA_and_Apps_3.80/bin:/home/mosquito/HP_Fortify/HP_Fortify_SCA_and_Apps_3.80/bin
zsh cat /etc/shells
/etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/bin/zsh
/usr/bin/zsh
8

3 Answers

To reset your zsh configuration, remove all instances of .zshrc and any .zshrc.??? swap files you may have left over from previous edits.

rm -f ~/.zshrc*

Then, close your terminal session and re-open. You should get the "new user" screen. Select the options from the menu prompts to create a new recommended starting point for your .zshrc configuration and add any prompts or other options you need.

That should do it.

Just be sure that zsh is in /etc/shells file.

which zsh

Will verify the path to your zsh shell.

Set the default shell to zsh, if not already done with

chsh -s $(which zsh)

Verify your FPATH contains the zsh functions and site-functions folders.

Hopefully, all is well.

0

I ended up copying the contents from the template file in the github repo into my ~/.zshrc file that I'd messed up, found here:

I would just like to add, that in case you are using something like oh-my-zsh, then instead of just deleting the .zshrc file, You need to copy the standard default .zshrc file.

Use this command instead:

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like