Gary Chu
1 min readAug 2, 2018

--

要有像這篇介紹的漂亮介面,必須使用 zsh 代替你原本預設的 shell 環境 (通常預設是 /bin/bash)。

在安裝 oh-my-zsh 的過程會把預設的 shell 環境改成 zsh,你原本的 .bashrc 或 .bash_profile 是 /bin/bash 在用的,zsh 並不會主動去 source 他們,zsh 啓動時只會 source .zshrc,這也是為什麼你會需要在 .zshrc 加上 source ~/.bash_profile

如果說你之後只打算用 zsh,那可以考慮把 .bashrc 和 .bash_profile 的內容轉移到 .zshrc。但如果你有切換不同 shell 的需求,那我建議你可以另外建立一個獨立的檔案(以我自己來說我有一個 .common_shell_rc 檔案),將不同 shell 共同用到的設定放在這個檔案裡,然後在每個 shell 預設會去 source 的那個檔案中,加上 source ~/.[your_common_rc_file]

希望這可以解決你的問題

--

--

Gary Chu
Gary Chu

No responses yet