Skip to content

Code output unreadable in light mode #16470

@Gobutah

Description

@Gobutah

Description

Formatted code is invisible, probably due to color scheme bug:

Image This was with opencode color scheme. It is impossible to read the "Hello World" because it is rendered white on white. Session transcript (copied with "Copy session transcript" call):
---

## User

Print out the following with the surrounding ```:
```
Hello
World
```

---

## Assistant (Plan · minimax-m2.5-free · 7.1s)

_Thinking:_

The user is asking me to print out some text with code fence formatting. This is a simple request to display text in a specific format. However, I notice there's a system reminder saying I'm in "Plan Mode" which suggests I should be in read-only mode and not make any changes.

But looking at this request - it's just asking me to print/output text in a specific format. This isn't making any edits to files or system changes. It's simply displaying text back to the user in the format they requested.

Let me provide the output as requested.

```
Hello
World
```

---


I tried to set every possible color of the opencode theme to gray in a custom theme

{
  "$schema": "https://opencode.ai/theme.json",
  "defs": {
    "darkStep1": "#484848",
    "darkStep2": "#484848",
    "darkStep3": "#484848",
    "darkStep4": "#484848",
    "darkStep5": "#484848",
    "darkStep6": "#484848",
    "darkStep7": "#484848",
    "darkStep8": "#484848",
    "darkStep9": "#484848",
    "darkStep10": "#484848",
    "darkStep11": "#484848",
    "darkStep12": "#484848",
    "darkSecondary": "#484848",
    "darkAccent": "#484848",
    "darkRed": "#484848",
    "darkOrange": "#484848",
    "darkGreen": "#484848",
    "darkCyan": "#484848",
    "darkYellow": "#484848",
    "lightStep1": "#484848",
    "lightStep2": "#484848",
    "lightStep3": "#484848",
    "lightStep4": "#484848",
    "lightStep5": "#484848",
    "lightStep6": "#484848",
    "lightStep7": "#484848",
    "lightStep8": "#484848",
    "lightStep9": "#484848",
    "lightStep10": "#484848",
    "lightStep11": "#484848",
    "lightStep12": "#484848",
    "lightSecondary": "#484848",
    "lightAccent": "#484848",
    "lightRed": "#484848",
    "lightOrange": "#484848",
    "lightGreen": "#484848",
    "lightCyan": "#484848",
    "lightYellow": "#484848"
  },
  "theme": {
    "primary": {
      "dark": "darkStep9",
      "light": "lightStep9"
    },
    "secondary": {
      "dark": "darkSecondary",
      "light": "lightSecondary"
    },
    "accent": {
      "dark": "darkAccent",
      "light": "lightAccent"
    },
    "error": {
      "dark": "darkRed",
      "light": "lightRed"
    },
    "warning": {
      "dark": "darkOrange",
      "light": "lightOrange"
    },
    "success": {
      "dark": "darkGreen",
      "light": "lightGreen"
    },
    "info": {
      "dark": "darkCyan",
      "light": "lightCyan"
    },
    "text": {
      "dark": "darkStep12",
      "light": "lightStep12"
    },
    "textMuted": {
      "dark": "darkStep11",
      "light": "lightStep11"
    },
    "background": {
      "dark": "darkStep1",
      "light": "lightStep1"
    },
    "backgroundPanel": {
      "dark": "darkStep2",
      "light": "lightStep2"
    },
    "backgroundElement": {
      "dark": "darkStep3",
      "light": "lightStep3"
    },
    "border": {
      "dark": "darkStep7",
      "light": "lightStep7"
    },
    "borderActive": {
      "dark": "darkStep8",
      "light": "lightStep8"
    },
    "borderSubtle": {
      "dark": "darkStep6",
      "light": "lightStep6"
    },
    "diffAdded": {
      "dark": "#4fd6be",
      "light": "#484848"
    },
    "diffRemoved": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffContext": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffHunkHeader": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffHighlightAdded": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffHighlightRemoved": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffAddedBg": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffRemovedBg": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffContextBg": {
      "dark": "darkStep2",
      "light": "lightStep2"
    },
    "diffLineNumber": {
      "dark": "darkStep3",
      "light": "lightStep3"
    },
    "diffAddedLineNumberBg": {
      "dark": "#484848",
      "light": "#484848"
    },
    "diffRemovedLineNumberBg": {
      "dark": "#484848",
      "light": "#484848"
    },
    "markdownText": {
      "dark": "darkStep12",
      "light": "lightStep12"
    },
    "markdownHeading": {
      "dark": "darkAccent",
      "light": "lightAccent"
    },
    "markdownLink": {
      "dark": "darkStep9",
      "light": "lightStep9"
    },
    "markdownLinkText": {
      "dark": "darkCyan",
      "light": "lightCyan"
    },
    "markdownCode": {
      "dark": "darkGreen",
      "light": "lightGreen"
    },
    "markdownBlockQuote": {
      "dark": "darkYellow",
      "light": "lightYellow"
    },
    "markdownEmph": {
      "dark": "darkYellow",
      "light": "lightYellow"
    },
    "markdownStrong": {
      "dark": "darkOrange",
      "light": "lightOrange"
    },
    "markdownHorizontalRule": {
      "dark": "darkStep11",
      "light": "lightStep11"
    },
    "markdownListItem": {
      "dark": "darkStep9",
      "light": "lightStep9"
    },
    "markdownListEnumeration": {
      "dark": "darkCyan",
      "light": "lightCyan"
    },
    "markdownImage": {
      "dark": "darkStep9",
      "light": "lightStep9"
    },
    "markdownImageText": {
      "dark": "darkCyan",
      "light": "lightCyan"
    },
    "markdownCodeBlock": {
      "dark": "darkStep12",
      "light": "lightStep12"
    },
    "syntaxComment": {
      "dark": "darkStep11",
      "light": "lightStep11"
    },
    "syntaxKeyword": {
      "dark": "darkAccent",
      "light": "lightAccent"
    },
    "syntaxFunction": {
      "dark": "darkStep9",
      "light": "lightStep9"
    },
    "syntaxVariable": {
      "dark": "darkRed",
      "light": "lightRed"
    },
    "syntaxString": {
      "dark": "darkGreen",
      "light": "lightGreen"
    },
    "syntaxNumber": {
      "dark": "darkOrange",
      "light": "lightOrange"
    },
    "syntaxType": {
      "dark": "darkYellow",
      "light": "lightYellow"
    },
    "syntaxOperator": {
      "dark": "darkCyan",
      "light": "lightCyan"
    },
    "syntaxPunctuation": {
      "dark": "darkStep12",
      "light": "lightStep12"
    }
  }
}

This is the same session rendered with the above theme:

Image

This means that code output enclosed in "```" is always rendered white and that this cannot be controlled with the color scheme, at least it can't be controlled with the settings present in the opencode theme (maybe there exist more color settings and opencode theme just did not set them so they are white by default?).

Plugins

No response

OpenCode version

1.2.20

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Linux Mint 21.2

Terminal

gnome-terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions