I have been using zsh for quite some time now and learned something new while setting up some commands today. I was trying to reload zsh configuration after making some changes. I knew it was a source command but did not remember the complete one. So I googled and found that there is a new way to do it now too.
The source command has been the go to way of reloading your zsh config. Simply type in:
source ~/.zshrc
BashAnd it works without any errors. But I recently learned of a newer way.
As is the nature of things in programming land, new things always come to the stage and omz added a new alias to make reloading zshrc configuration more rememberable. The new command to reload zsh configuration is:
omz reload
BashI also found out another interesting thing. I assumed it was an alias to the source command under the hood but turns out that it is an alias for
exec zsh
BashThe exec command is different than source because it completely reloads the zsh process. This means that the exec command removes any env variables that were set before in the configuration which can be a better default than having a rogue state after doing a reload.
So if you’re an omz user, you can use the reload command or for other zsh users, you can use the exec command which is probably easier to remember too. And those are the 2 ways to reload your zshrc configuration.
While working on a project, I wanted to do an integrity check of a file…
Popovers have been a problem that was typically solved by using a third-party solution. But…
Node.js 20.6 added built-in support for the .env file. This is an excellent addition to the platform…
Object destructuring is a powerful ES 6 feature that can help developers write cleaner code.…
Have you felt particularly annoyed by the time it takes to clone a large repository,…
Within a React or Next.js app, if you encounter the error "Hydration failed because the…