如何在Win10上配置windows terminal、git bash、zsh及oh-my-zsh的终端开发环境?

摘要:1、安装 git for windows 下载地址:https:gitforwindows.org,下载好之后,全部采用默认安装。 2、安装终端 Windows 上的终端有很多种,纯 git-bash 不支持交互输入(例如输入 pyth
目录1、安装 git for windows2、安装终端2.1 Windows Terminal2.1.1 安装 Windows Terminal2.1.2 设置 Windows Terminal2.2 Hyper2.2.1 安装 Hyper2.2.2 配置 Hyper4、安装 zsh5、安装 Oh my zsh参考链接 1、安装 git for windows 下载地址:https://gitforwindows.org,下载好之后,全部采用默认安装。 2、安装终端 Windows 上的终端有很多种,纯 git-bash 不支持交互输入(例如输入 python 后一直卡着,不能出现 > ),这里介绍两个可交互终端: Windows Terminal (windows 上装 Windows Terminal 不简单,建议小白用户用 Hyper) Hyper 2.1 Windows Terminal 2.1.1 安装 Windows Terminal Microsoft Store,或从 Windows 开始菜单中启动 Microsoft Store 应用程序并搜索 Terminal。 注意: 注意不要选择早期的 Windows Terminal Preview 应用程序。 注意: 其对 windows 版本有要求,需要更新系统(更新系统卡死在 99%,需要参考参考链接2;有些浏览器连易升都下载不了,建议用 google 浏览器) 2.1.2 设置 Windows Terminal 启动 Windows Terminal,点击设置 添加新配置文件->新增新配置->别忘了保存 设置->选择默认为 git bash 2.2 Hyper 2.2.1 安装 Hyper 去 Hyper 官网下载:https://hyper.is 点击下载 然后默认安装即可。 2.2.2 配置 Hyper 右键打开 Hyper,然后菜单->Edit->Preferences,会弹出一个配置文件,在如下位置增加一行配置: // // Windows Subsystem for Linux (WSL) - previously Bash on Windows // - Example: `C:\\Windows\\System32\\wsl.exe` // // Git-bash on Windows // - Example: `C:\\Program Files\\Git\\bin\\bash.exe` // // PowerShell on Windows // - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` // // Cygwin // - Example: `C:\\cygwin64\\bin\\bash.exe` shell: 'C:\\Program Files\\Git\\bin\\bash.exe', <---- 这里,这里,这里(这里的 bash.exe 就是第一步 git 安装路径) // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`) // by default `['--login']` will be used shellArgs: ['--login'], // for environment variables env: {}, // Supported Options: // 1. 'SOUND' -> Enables the bell as a sound // 2. false: turns off the bell 配置好之后,保存重启 Hyper,就会看到 Hyper 已经使用了 git-bash。
阅读全文