[LINUX] 在 Win10 上搭建好用的終端開發環境:windows terminal + git bash + zsh + oh-my-zsh



1、安裝 Windows Terminal

Microsoft Store,或從 Windows 開始菜單中啓動 Microsoft Store 應用程序並搜索 Terminal

注意: 注意不要選擇早期的 Windows Terminal Preview 應用程序。

注意: 其對 windows 版本有要求,需要更新系統(更新系統卡死在 99%,需要參考參考鏈接2;有些瀏覽器連易升都下載不了,建議用 google 瀏覽器)


2、安裝 git for windows

下載地址:https://gitforwindows.org,下載好之後,全部採用默認安裝。


3、設置 Windows Terminal

  • 啓動 Windows Terminal,點擊設置

  • 添加新配置文件->新增新配置->別忘了保存

  • 設置->選擇默認爲 git bash


4、安裝 zsh

  • MSYS2 網站可以下載到最新的 zsh 安裝包:zsh-5.8-5-x86_64.pkg.tar.zst

  • 由於下載的是 zst 後綴文件,Windows 上需要安裝 PeaZip 工具(下載8.30以上版本)

  • 下載完成後解壓再解壓,可以看到文件如下:

  • 將這些文件直接解壓到 Git 的安裝目錄下,與之前的文件進行合併,可以理解爲把 zsh 當作 git bash 的一個補充安裝包:

  • 此時我們打開 git bash,敲下 zsh,就會看到我們已經成功


5、安裝 Oh my zsh

在 zsh 裏執行(curl)

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 或者 
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

或者用 wget

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

最後,用 VIM 編輯 ~/.bashrc 文件,在其最後加入 zsh,表示終端打開默認執行 zsh。


參考鏈接

[1]. Windows Terminal完整指南
[2]. Windows 10更新失敗在百分99處卡住的處理方法
[3]. Install Terminal + git-bash + zsh + oh-my-zsh on Windows 10



: 陸續更新中...

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章