Snacks Zen Mode Font Size with Ghostty on macOS

If you use LazyVim with Ghostty on macOS, you might have noticed that zen mode doesn’t change your font size — unlike Kitty or WezTerm which have official plugins.

Ghostty doesn’t support escape sequences for font size changes, but you can work around it using AppleScript to simulate keyboard shortcuts. Add this to your ~/.config/nvim/lua/plugins/snacks.nvim config:

{
  "folke/snacks.nvim",
  opts = {
    zen = {
      on_open = function()
        vim.fn.system("osascript -e 'tell application \"Ghostty\" to activate' -e 'tell application \"System Events\" to keystroke \"+\" using command down'")
      end,
      on_close = function()
        vim.fn.system("osascript -e 'tell application \"Ghostty\" to activate' -e 'tell application \"System Events\" to keystroke \"0\" using command down'")
      end,
    },
  },
}

This simulates Cmd++ when entering zen mode and Cmd+0 to reset on exit. You’ll need to grant Accessibility permissions for Ghostty when prompted or in System Settings → Privacy & Security → Accessibility.