Fixing Opencode Transparency in Ghostty Terminal
在Ghostty终端中使用Opencode时,默认情况下其TUI不会显示透明背景。通过将Opencode的主题设置为"system",可以让其尊重终端的透明背景设置。 2025-7-18 12:0:0 Author: danielmiessler.com(查看原文) 阅读量:4 收藏

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!


文章来源: https://danielmiessler.com/blog/opencode-ghostty-transparency-fix
如有侵权请联系:admin#unsafe.sh