网上都说ghostty 配置 cc 更好用表现比 iTerm2 更好今天来试试。star 数比 Kitty 多些由 zig 编写。https://ghostty.org/https://github.com/ghostty-org/ghostty仍然用包管理器的方式安装brew install --cask ghosttyTips: 一些使用快捷键cmd D 分屏cmd shift D 向下分屏cmd w 关闭当前分屏配置Mac 配置参考文档https://ghostty.org/docs/config/reference配置项参考https://blog.axiaoxin.com/post/ghostty-config-guide/ghostty 官网的描述是开箱即用无需多余配置。符合绝大多数人需求意味着不改配置就可以用起来了。解释下名词GTK终端 GTK (GIMP Toolkit) 是用于在 Linux 等 Unix-like 系统上创建图形用户界面 (GUI)的开源工具包。Terminfo终端信息Terminfo用于告知应用软件当前终端的功能以便正确控制。Ghostty 自带终端信息列表用于展示其特性。okay 安装完成按照惯例来配置下更花哨些。默认配置目录在$HOME/.config/ghostty/config。也可以通过$XDG_CONFIG_HOME更改更新路径之后为$XDG_CONFIG_HOME/ghostty/config。两个路径都存在配置时按照配置惯例优先级覆盖原则。配置更新完生效有两种方案一是ctrlshift,二是传统方式新开一个 terminal。字体ghostty 内置默认字体是JetBrains Mono使用ghostty list-fonts查看所有字体。# font settingsfont-size16但是默认的字体对中文似乎不太友好解决上述问题可以改为以下配置font-familySymbols Nerd Font Mono font-familyPragmataPro Liga font-familySarasa Mono SC font-family-boldPragmataPro Liga font-family-italicPragmataPro Liga font-family-bold-italicPragmataPro Liga开启一些 ghostty 的连字配置和一些字体特性font-featurecalt# 连字font-featureliga font-featuress13 window-inherit-font-sizetrue总体感觉还阔以截图展示屏幕宽度和高度不配置使用默认也可。window-height30window-width100主题主题配置同样遵守上述的配置规则默认路径为~/.config/ghostty/themes。Ghostly 自带许多主题总共有 395 个都在/Applications/Ghostty.app/Contents/Resources/ghostty/themes路径下。在 ghostty 终端下执行ghostty list-themes会出现对应的主题预览以便查看和选择主题。个人感觉Blue Matrix 和 BuiltinDarkBright LightsPro 似乎都不错themePro美化配置window-vsynctrueadjust-cursor-thickness3adjust-underline-position3bold-is-brighttruecursor-invert-fg-bgtruecursor-opacity0.8cursor-stylebar mouse-hide-while-typingtruewindow-vsynctruebackground-opacity0.9background-blurtruemacos-iconcustom-style macos-icon-ghost-color#D8D0E8macos-icon-screen-color#000000macos-icon-frameplastic快捷键使用ghostty list-keybinds --default列出所有可用的快捷键。功能性配置copy-on-selectclipboard link-urltruelink-previewstrue配置概览# # 字体设置 # font-family Symbols Nerd Font Mono font-family PragmataPro Liga font-family Sarasa Mono SC font-family-bold PragmataPro Liga font-family-italic PragmataPro Liga font-family-bold-italic PragmataPro Liga # 上下文替代 font-feature calt # 连字 font-feature liga # Stylistic Set 13 font-feature ss13 font-size 16 window-inherit-font-size true # # 窗口设置 # window-height 30 window-width 100 # 垂直同步仅 macOS 支持 window-vsync true # # 光标设置 # cursor-style bar # 反转前景/背景色 cursor-invert-fg-bg true cursor-opacity 0.8 adjust-cursor-thickness 3 adjust-underline-position 3 adjust-cell-height 2 # # 外观设置 # theme Catppuccin Mocha background-opacity 0.8 background-blur-radius 30 background-blur true # background-image /Users/shown/Downloads/ghostty-bgc.jpeg # background-image-fit stretch bold-is-bright true # # 行为设置 # # 自动识别链接 copy-on-select clipboard link-url true link-previews true mouse-hide-while-typing true shell-integration zsh # # macOS 专用设置 # macos-icon custom-style macos-icon-ghost-color #D8D0E8 macos-icon-screen-color #000000 macos-icon-frame plastic配置的效果大概是注意事项在 ghostty 中如果 vim 或者 tmux 高亮不生效需要下面这样的配置https://github.com/tmux/tmux/issues/1246# .vimrc Enable true color 启用终端24位色 if exists(termguicolors) let t_8f \Esc[38;2;%lu;%lu;%lum let t_8b \Esc[48;2;%lu;%lu;%lum set termguicolors endif # .tmux.conf # importent 开启24 bit color 其他方式都无效 set -g default-terminal tmux-256color set -ga terminal-overrides ,*256col*:Tc
Ghostty 终端模拟器 配置指南
网上都说ghostty 配置 cc 更好用表现比 iTerm2 更好今天来试试。star 数比 Kitty 多些由 zig 编写。https://ghostty.org/https://github.com/ghostty-org/ghostty仍然用包管理器的方式安装brew install --cask ghosttyTips: 一些使用快捷键cmd D 分屏cmd shift D 向下分屏cmd w 关闭当前分屏配置Mac 配置参考文档https://ghostty.org/docs/config/reference配置项参考https://blog.axiaoxin.com/post/ghostty-config-guide/ghostty 官网的描述是开箱即用无需多余配置。符合绝大多数人需求意味着不改配置就可以用起来了。解释下名词GTK终端 GTK (GIMP Toolkit) 是用于在 Linux 等 Unix-like 系统上创建图形用户界面 (GUI)的开源工具包。Terminfo终端信息Terminfo用于告知应用软件当前终端的功能以便正确控制。Ghostty 自带终端信息列表用于展示其特性。okay 安装完成按照惯例来配置下更花哨些。默认配置目录在$HOME/.config/ghostty/config。也可以通过$XDG_CONFIG_HOME更改更新路径之后为$XDG_CONFIG_HOME/ghostty/config。两个路径都存在配置时按照配置惯例优先级覆盖原则。配置更新完生效有两种方案一是ctrlshift,二是传统方式新开一个 terminal。字体ghostty 内置默认字体是JetBrains Mono使用ghostty list-fonts查看所有字体。# font settingsfont-size16但是默认的字体对中文似乎不太友好解决上述问题可以改为以下配置font-familySymbols Nerd Font Mono font-familyPragmataPro Liga font-familySarasa Mono SC font-family-boldPragmataPro Liga font-family-italicPragmataPro Liga font-family-bold-italicPragmataPro Liga开启一些 ghostty 的连字配置和一些字体特性font-featurecalt# 连字font-featureliga font-featuress13 window-inherit-font-sizetrue总体感觉还阔以截图展示屏幕宽度和高度不配置使用默认也可。window-height30window-width100主题主题配置同样遵守上述的配置规则默认路径为~/.config/ghostty/themes。Ghostly 自带许多主题总共有 395 个都在/Applications/Ghostty.app/Contents/Resources/ghostty/themes路径下。在 ghostty 终端下执行ghostty list-themes会出现对应的主题预览以便查看和选择主题。个人感觉Blue Matrix 和 BuiltinDarkBright LightsPro 似乎都不错themePro美化配置window-vsynctrueadjust-cursor-thickness3adjust-underline-position3bold-is-brighttruecursor-invert-fg-bgtruecursor-opacity0.8cursor-stylebar mouse-hide-while-typingtruewindow-vsynctruebackground-opacity0.9background-blurtruemacos-iconcustom-style macos-icon-ghost-color#D8D0E8macos-icon-screen-color#000000macos-icon-frameplastic快捷键使用ghostty list-keybinds --default列出所有可用的快捷键。功能性配置copy-on-selectclipboard link-urltruelink-previewstrue配置概览# # 字体设置 # font-family Symbols Nerd Font Mono font-family PragmataPro Liga font-family Sarasa Mono SC font-family-bold PragmataPro Liga font-family-italic PragmataPro Liga font-family-bold-italic PragmataPro Liga # 上下文替代 font-feature calt # 连字 font-feature liga # Stylistic Set 13 font-feature ss13 font-size 16 window-inherit-font-size true # # 窗口设置 # window-height 30 window-width 100 # 垂直同步仅 macOS 支持 window-vsync true # # 光标设置 # cursor-style bar # 反转前景/背景色 cursor-invert-fg-bg true cursor-opacity 0.8 adjust-cursor-thickness 3 adjust-underline-position 3 adjust-cell-height 2 # # 外观设置 # theme Catppuccin Mocha background-opacity 0.8 background-blur-radius 30 background-blur true # background-image /Users/shown/Downloads/ghostty-bgc.jpeg # background-image-fit stretch bold-is-bright true # # 行为设置 # # 自动识别链接 copy-on-select clipboard link-url true link-previews true mouse-hide-while-typing true shell-integration zsh # # macOS 专用设置 # macos-icon custom-style macos-icon-ghost-color #D8D0E8 macos-icon-screen-color #000000 macos-icon-frame plastic配置的效果大概是注意事项在 ghostty 中如果 vim 或者 tmux 高亮不生效需要下面这样的配置https://github.com/tmux/tmux/issues/1246# .vimrc Enable true color 启用终端24位色 if exists(termguicolors) let t_8f \Esc[38;2;%lu;%lu;%lum let t_8b \Esc[48;2;%lu;%lu;%lum set termguicolors endif # .tmux.conf # importent 开启24 bit color 其他方式都无效 set -g default-terminal tmux-256color set -ga terminal-overrides ,*256col*:Tc