Ghostty Configuration

From Rest of What I Know

I got recently annoyed with iTerm2 encountering random lag and using infinite CPU slowing everything down. It happened at a moment of personal exasperation so I decided to try out Ghostty since I've tried alacritty before and it was too minimal for me. I know some people prefer managing their panes in tmux but I prefer having my terminal emulator provide windowing features. So the minimal amount of things I needed were:

  • Window Splits
  • Tabs
  • Keyboard control on MacOS to move between those

After I actually used Ghostty, I realized I also wanted:

  • A block cursor, that in neovim follows the insert-mode-bar, normal-mode-block convention
  • Support for Shift-Enter in Claude Code

Ghostty fortunately supports both of these, though it has its MacOS configuration file in a very MacOS location and I would have preferred that it live in ~/.config. It claims to support that path but doesn't actually seem to, so I just decided to use the weird "Application Support" path. In any case, here are the requisite configuration options

# Cursor configuration
# https://github.com/ghostty-org/ghostty/discussions/3836
cursor-style = block
cursor-style-blink = false
# no-cursor removes the default blinking bar
# ssh-terminfo,ssh-env,sudo transmit the terminfo so CLIs know how to handle paging / colors
shell-integration-features = no-cursor,ssh-terminfo,ssh-env,sudo

# Claude Code Shift-Enter
# https://github.com/anthropics/claude-code/issues/1282
keybind = shift+enter=text:\x1b\r

You do need the shell integration features around ssh and sudo or otherwise you'll get messages like "WARNING: Terminal is not fully functional" any time you try to use a pager and your extra long commands won't wrap to the next line like you expect. The latter one is what prompted me to find these settings because it's impossible to read your own command when you have to scroll to remember the rest of it.