
Ghostty是值得尝试的终端模拟器:GPU加速+零配置+完美分屏,5分钟就能上手,开发体验直接起飞。
你有没有遇到过这些崩溃时刻:
我以前也是这样,直到上周试了Ghostty。
5分钟搞定配置,Cmd+D一键分屏,GPU加速丝滑流畅。现在每天开发离不开它。
今天,我手把手带你配置Ghostty,保证你看了就能用,用了就回不去。
Ghostty是HashiCorp联合创始人Mitchell Hashimoto在2021年启动的"副业项目",2024年底正式开源。

根据官方GitHub数据,Ghostty开源后迅速成为2024年增长最快的终端项目之一。
三个核心优势:
一句话:Ghostty不逼你"要么快要么丑"——它全都要。而且完全免费开源。
第一步:安装(1分钟)
macOS用户:
brew install --cask ghostty
安装后,在Spotlight中搜索"Ghostty"打开。第一次可能弹出两个窗口(一个是下拉终端),别慌,后面会修复。
Linux用户:
# Ubuntu/Debian
sudo apt install ghostty
# Arch Linux
yay -S ghostty
# 或者从源码编译(需要Zig编译器)
git clone https://github.com/ghostty-org/ghostty
cd ghostty
zig build -Doptimize=ReleaseFast
第二步:基础配置(2分钟)
Ghostty的配置文件在 ~/.config/ghostty/config。
打开配置文件:
mkdir -p ~/.config/ghostty
open ~/.config/ghostty/config # macOS
# 或者 nano ~/.config/ghostty/config # Linux
粘贴这个最小配置(我已经帮你踩过坑了):
# 主题
theme = Catppuccin Mocha
# 字体
font-family = "JetBrains Mono"
font-size = 14
# 分屏快捷键
keybind = cmd+d=new_split:right
keybind = cmd+shift+d=new_split:down
keybind = cmd+w=close_surface
keybind = cmd+shift+enter=toggle_fullscreen
# 窗口设置
window-padding-x = 10
window-padding-y = 10
background-opacity = 0.95
# 保存布局
window-save-state = always
保存后,按**Cmd + Shift + ,**重新加载配置(或重启Ghostty)。
第三步:测试分屏(2分钟)
按Cmd + D → 右边出现新分屏
试试左边跑npm run dev,右边开tail -f logs/app.log——流畅得不敢相信。

Ghostty的分屏逻辑超级直观:
*Cmd + D = 右边加屏幕(适合左代码、右日志) *Cmd + Shift + D = 下方加屏幕(适合上代码、下监控)
真实场景:
左边:claude命令启动Claude Code
右边:fastfetch显示系统信息
下方:btop实时监控CPU/内存
三个窗口同时工作,零卡顿。布局自动保存,下次打开Ghostty直接恢复。
Ghostty内置200+主题,我测试了最流行的10个:

切换主题,只需在配置文件中改theme = 主题名,然后**Cmd + Shift + ,**重新加载。
Ghostty的快捷键配置超级灵活,格式:
keybind = 按键组合=动作
我常用的自定义快捷键:
# 快速清屏
keybind = cmd+k=clear_screen
# 新建标签页
keybind = cmd+t=new_tab
# 切换标签页
keybind = cmd+1=goto_tab:1
keybind = cmd+2=goto_tab:2
# 搜索
keybind = cmd+f=search
完整动作列表见官方文档:
https://ghostty.org/docs/keybindings
我花了一个下午实测三大主流终端,数据如下:

结论:
我个人选Ghostty,因为快、轻量、配置简单,而且开源社区非常活跃。
Starship是跨shell的提示工具,显示Git分支、执行时间、语言版本等。
# 安装
brew install starship
# 应用Catppuccin主题
starship preset catppuccin-powerline -o ~/.config/starship.toml
# 添加到 ~/.zshrc 末尾
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
# 重启Ghostty
效果:命令行前有彩虹色的Git分支、执行时间、目录路径——超级好看。
# 安装工具
brew install fastfetch btop
# 使用
fastfetch # 显示系统信息(CPU、内存、OS版本等)
btop # 实时监控CPU、内存、进程
配合分屏:
左边:开发窗口
右上:fastfetch显示系统信息
右下:btop实时监控资源
如果你用Claude Code(Anthropic的AI编码助手),Ghostty是完美搭档:
# 安装Claude Code CLI
npm install -g @anthropic-ai/claude-code
# 在Ghostty中启动
claude
让Claude在左边写代码,右边开分屏跑测试——效率直接翻倍。
Q: Ghostty支持Windows吗?
A: 目前只支持macOS和Linux,Windows支持正在开发中。
Q: 配置文件在哪?
A: ~/.config/ghostty/config
Q: 分屏布局会保存吗?
A: 会!只要配置了window-save-state = always,下次打开Ghostty自动恢复之前的分屏布局。
我把完整配置放在这里,包含:
完整配置代码:
# 主题
theme = Catppuccin Mocha
# 字体
font-family = "JetBrains Mono"
font-size = 14
# 分屏快捷键
keybind = cmd+d=new_split:right
keybind = cmd+shift+d=new_split:down
keybind = cmd+w=close_surface
keybind = cmd+shift+enter=toggle_fullscreen
# 快捷操作
keybind = cmd+k=clear_screen
keybind = cmd+t=new_tab
keybind = cmd+1=goto_tab:1
keybind = cmd+2=goto_tab:2
keybind = cmd+f=search
# 窗口设置
window-padding-x = 10
window-padding-y = 10
background-opacity = 0.95
window-save-state = always
# 性能优化
shell-integration = detect
使用说明:
# 1. 备份原配置(如果有)
mv ~/.config/ghostty/config ~/.config/ghostty/config.bak
# 2. 创建配置目录
mkdir -p ~/.config/ghostty
# 3. 复制上面的配置,粘贴到文件中
nano ~/.config/ghostty/config
# 或者 open ~/.config/ghostty/config (macOS)
# 4. 保存后,在Ghostty中按 Cmd + Shift + , 重新加载
Ghostty不是完美的终端,但它解决了我80%的痛点:
如果你受够了终端卡顿、分屏麻烦、配置复杂,花5分钟试试Ghostty。
立即行动:
原文链接:Ghostty 终端 - 汇智网
更新时间:2026-03-24
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight All Rights Reserved.
Powered By 61893.com 闽ICP备11008920号
闽公网安备35020302034844号