支持的 Shell
Warp 支持 macOS、Windows 和 Linux 上流行的 Shell。
✅ 支持的 Shell 列表
系统平台 | 支持的 Shell |
---|---|
macOS | bash , zsh , fish , PowerShell (pwsh) |
Linux | bash , zsh , fish , PowerShell (pwsh) |
Windows | PowerShell 5 , PowerShell 7 (pwsh) , WSL2 , Git Bash |
🚀 Warp 的默认 Shell
Warp 会默认加载你的「登录 Shell」。如果你的默认 Shell 是:
- 支持的(如 zsh、bash、fish、pwsh):Warp 会自动使用该 Shell。
- 不支持的(如 Nushell):Warp 会弹出提示,并回退到以下系统默认 Shell:
系统 | 默认 Shell |
---|---|
macOS | zsh |
Windows | PowerShell 7 (pwsh) |
Linux | bash |
如遇 .bashrc
、.zshrc
、config.fish
或 PowerShell_profile.ps1
配置问题,请参考官方文档:RC 文件配置与调试。
🔧 如何更改 Warp 使用的默认 Shell
你可以通过以下路径设置:
Warp > Settings > Features > Session > Startup shell for new sessions
变更后的 Shell 设置将从新会话起生效(新开窗口、标签页或面板)。
🧩 Shell 配置指南
zsh 配置(macOS/Linux)
- 配置文件:
~/.zshrc
编辑方式:
nano ~/.zshrc # 或 vi ~/.zshrc
使修改生效:
source ~/.zshrc
bash 配置(macOS/Linux)
- 配置文件:
~/.bashrc
(非登录)或~/.bash_profile
(登录) 编辑方式:
nano ~/.bashrc
使修改生效:
source ~/.bashrc
fish 配置(macOS/Linux)
- 配置文件:
~/.config/fish/config.fish
编辑方式:
nano ~/.config/fish/config.fish
使修改生效:
source ~/.config/fish
环境变量写法不同:
set -Ux VAR_NAME value
PowerShell 配置(macOS/Windows)
- 配置文件路径:
$PROFILE
检查文件是否存在:
Test-Path $PROFILE
创建文件(如不存在):
New-Item -Path $PROFILE -ItemType File -Force
编辑配置文件:
code $PROFILE # 用 VS Code 打开
启用脚本执行(如被阻止):
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
🖥 macOS 上额外配置说明
使用 zsh
- macOS 默认使用
/bin/zsh
。 检查路径:
which zsh
zsh --version
安装 & 使用 fish
步骤 1:安装 fish
使用 Homebrew:
brew install fish
- 或者从官网下载安装包:fishshell.com
步骤 2:设为默认 Shell
echo $(which fish) | sudo tee -a /etc/shells
chsh -s $(which fish)
注意路径差异:
- Intel Mac →
/usr/local/bin/fish
- Apple Silicon →
/opt/homebrew/bin/fish
检查路径:
which fish
安装 & 使用 PowerShell (pwsh)
步骤 1:安装 pwsh
使用 Homebrew:
brew install powershell/tap/powershell
- 或从 Microsoft 官方网站 下载。
步骤 2:设为默认 Shell
echo $(which pwsh) | sudo tee -a /etc/shells
chsh -s $(which pwsh)
Apple Silicon 默认路径为:/opt/homebrew/bin/pwsh
检查路径:
which pwsh
🪟 Windows Shell 支持情况
Warp for Windows 默认使用 PowerShell 7 (pwsh)
。支持以下终端:
- PowerShell 7(默认)
- PowerShell 5
- WSL2(适用于 Linux 开发环境)
- Git Bash(适合使用 Git 和类 UNIX 工具)
如需进一步帮助或出现配置问题,请查看 Warp 的 官方文档。如果你希望我为你写具体的配置文件内容,也欢迎告诉我你的使用场景和系统平台!