osx, zsh,

How to solve .bash_profile not working in zsh

Tony Tony Follow Oct 29, 2019 · 1 min read
How to solve .bash_profile not working in zsh
Share this

問題描述

將OSX的terminal從bash轉換成zsh,並安裝 oh-my-zsh plugin後,發現 .bash_profile自定義的項目都失效。

問題分析

oh-my-zsh有自己的配置文件 .zshrc ,因此原本的 .bash_profile 的設定並沒有生效。

解決方法

在 ~/.zshrc 裡頭多加上一行 source ~/.bash_profile,讓原先的設定項目生效。

$ vi ~/.zshrc

# add in the content of .zshrc
source ~/.bash_profile

$ source ~/.zshrc
Join Newsletter
Get the latest news right in your inbox. We never spam!
Tony
Written by Tony Follow
Hi, I am Tony, the author of Learning Journey blog. I hope you like what I sharing!