Fixing Opencode Transparency in Ghostty Terminal

How to make Opencode respect your terminal's transparent background
July 18, 2025

Opencode with transparent Ghostty terminal

Opencode running with transparent background in Ghostty (click for full size)

If you're using Opencode in Ghostty terminal and noticed that your beautiful transparent background disappears when Opencode launches, here's the fix.

The Problem

Opencode's TUI doesn't honor Ghostty's transparent background by default, making the Opencode part of your terminal opaque when the app runs.

The Solution

Configure Opencode to use its system theme, which adapts to your terminal's native appearance including transparency.

Quick Fix

  1. Open your Opencode config:

    bash
    nvim ~/.config/opencode/opencode.json
  2. Set the theme to system:

    json
    {
      "$schema": "https://opencode.ai/config.json",
      "theme": "system"
    }
  3. Save the file

  4. Restart Opencode

Now your Opencode will seamlessly blend with your terminal's transparency settings.

Happy hacking!

Notes

  1. This also works for other terminals with transparency like Alacritty or iTerm2.
  2. I am using this fine with the tokyonight theme as shown in the header image.
Thank you for reading...