Syntax highlighting completely broken in TUI - all code appears in single color #8612

Open
opened 2026-02-16 18:10:23 -05:00 by yindo · 2 comments
Owner

Originally created by @guidomb on GitHub (Feb 5, 2026).

Originally assigned to: @kommander on GitHub.

Description

Syntax highlighting in the TUI (Terminal User Interface) is completely broken - all code appears in a single color (yellowish-green) regardless of the theme selected. No differentiation between keywords, strings, comments, functions, or any other syntax elements.

This affects:

  • Markdown code blocks in AI responses
  • File content displayed via Read tool
  • All Elixir code (and likely other languages)

The OpenCode UI elements (borders, menus, status bar) correctly use the selected theme colors, but code syntax highlighting does not work at all.

Plugins

None

OpenCode version

1.1.51

Steps to reproduce

  1. Install OpenCode 1.1.51 on Arch Linux with Ghostty terminal
  2. Start OpenCode in any project directory: opencode
  3. Configure theme (tried multiple): tokyonight, catppuccin, system
  4. Ask the AI to display code or read a file
  5. Observe that all code appears in one color with no syntax highlighting

What I tried:

  • Multiple themes: tokyonight, catppuccin, system, nord
  • Disabling Omarchy theme manager temporarily
  • Fresh Ghostty terminal without any color configuration
  • Verified COLORTERM=truecolor is set
  • Verified terminal can display colors with printf '\e[31mRed\e[32mGreen\e[33mYellow\e[0m' (works correctly)
  • Changed OpenCode leader key from ctrl+x to alt+x (unrelated but part of troubleshooting)
  • Restarted OpenCode multiple times

Environment verification:

$ echo $COLORTERM
truecolor

$ echo $TERM
xterm-ghostty

$ echo $TERM_PROGRAM
ghostty

$ echo $TERM_PROGRAM_VERSION
1.2.3-arch2

# Color test works:
$ printf '\e[31mRed\e[0m \e[32mGreen\e[0m \e[33mYellow\e[0m \e[34mBlue\e[0m\n'
(Shows different colors correctly)

Screenshot and/or share link

Screenshots attached showing:

  1. Code displayed with all elements in same yellowish-green color
  2. No differentiation between defmodule, strings, atoms, comments, etc.
  3. OpenCode UI (borders/status) correctly using theme colors
Image Image

Operating System

Arch Linux (latest)

Terminal

Ghostty 1.2.3-arch2

Additional context:

Terminal configuration:

  • Using Omarchy theme manager (https://github.com/basecamp/omarchy) with Tokyo Night theme
  • Ghostty config includes: config-file = ?"~/.config/omarchy/current/theme/ghostty.conf"
  • Tested both with and without Omarchy theme loaded - same result
  • Ghostty palette is correctly configured with Tokyo Night colors:
    palette = 0=#32344a
    palette = 1=#f7768e
    palette = 2=#9ece6a
    palette = 3=#e0af68
    # ... etc (full 16-color palette defined)
    

OpenCode configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "theme": "system",
  "keybinds": {
    "leader": "alt+x"
  }
}

Related issues found:

  • #3711 - Syntax highlighting broken with tab characters (but our code has no tabs)
  • #12266 - Highlighting issues in tmux (not using tmux)
  • #4236 - ANSI color support issues in custom themes
  • #101 - Terminal theme colors support discussion

Expected behavior:
Based on documentation at https://opencode.ai/docs/themes/, syntax highlighting should work in the TUI with different colors for:

  • Keywords (defmodule, def, use, etc.) - purple/magenta
  • Strings - green
  • Atoms - cyan
  • Comments - gray
  • Module names - yellow/orange
  • Numbers - orange

Actual behavior:
Everything appears in a single yellowish-green color with no syntax differentiation whatsoever.

Possible root cause:
May be related to how OpenCode TUI applies ANSI color codes when terminal has a custom color palette configured, or how it interacts with terminals managed by theme managers like Omarchy.

Originally created by @guidomb on GitHub (Feb 5, 2026). Originally assigned to: @kommander on GitHub. ### Description Syntax highlighting in the TUI (Terminal User Interface) is completely broken - all code appears in a single color (yellowish-green) regardless of the theme selected. No differentiation between keywords, strings, comments, functions, or any other syntax elements. This affects: - Markdown code blocks in AI responses - File content displayed via Read tool - All Elixir code (and likely other languages) The OpenCode UI elements (borders, menus, status bar) correctly use the selected theme colors, but code syntax highlighting does not work at all. ### Plugins None ### OpenCode version 1.1.51 ### Steps to reproduce 1. Install OpenCode 1.1.51 on Arch Linux with Ghostty terminal 2. Start OpenCode in any project directory: `opencode` 3. Configure theme (tried multiple): `tokyonight`, `catppuccin`, `system` 4. Ask the AI to display code or read a file 5. Observe that all code appears in one color with no syntax highlighting **What I tried:** - Multiple themes: `tokyonight`, `catppuccin`, `system`, `nord` - Disabling Omarchy theme manager temporarily - Fresh Ghostty terminal without any color configuration - Verified `COLORTERM=truecolor` is set - Verified terminal can display colors with `printf '\e[31mRed\e[32mGreen\e[33mYellow\e[0m'` (works correctly) - Changed OpenCode leader key from `ctrl+x` to `alt+x` (unrelated but part of troubleshooting) - Restarted OpenCode multiple times **Environment verification:** ```bash $ echo $COLORTERM truecolor $ echo $TERM xterm-ghostty $ echo $TERM_PROGRAM ghostty $ echo $TERM_PROGRAM_VERSION 1.2.3-arch2 # Color test works: $ printf '\e[31mRed\e[0m \e[32mGreen\e[0m \e[33mYellow\e[0m \e[34mBlue\e[0m\n' (Shows different colors correctly) ``` ### Screenshot and/or share link Screenshots attached showing: 1. Code displayed with all elements in same yellowish-green color 2. No differentiation between `defmodule`, strings, atoms, comments, etc. 3. OpenCode UI (borders/status) correctly using theme colors <img width="1773" height="1848" alt="Image" src="https://github.com/user-attachments/assets/b8bb8f76-2f0e-48c1-a3bf-399dba799474" /> <img width="1543" height="795" alt="Image" src="https://github.com/user-attachments/assets/0d2d1f2c-9b16-47aa-ade7-5b077eb1ae45" /> ### Operating System Arch Linux (latest) ### Terminal Ghostty 1.2.3-arch2 **Additional context:** **Terminal configuration:** - Using Omarchy theme manager (https://github.com/basecamp/omarchy) with Tokyo Night theme - Ghostty config includes: `config-file = ?"~/.config/omarchy/current/theme/ghostty.conf"` - Tested both with and without Omarchy theme loaded - same result - Ghostty palette is correctly configured with Tokyo Night colors: ``` palette = 0=#32344a palette = 1=#f7768e palette = 2=#9ece6a palette = 3=#e0af68 # ... etc (full 16-color palette defined) ``` **OpenCode configuration:** ```json { "$schema": "https://opencode.ai/config.json", "theme": "system", "keybinds": { "leader": "alt+x" } } ``` **Related issues found:** - #3711 - Syntax highlighting broken with tab characters (but our code has no tabs) - #12266 - Highlighting issues in tmux (not using tmux) - #4236 - ANSI color support issues in custom themes - #101 - Terminal theme colors support discussion **Expected behavior:** Based on documentation at https://opencode.ai/docs/themes/, syntax highlighting should work in the TUI with different colors for: - Keywords (`defmodule`, `def`, `use`, etc.) - purple/magenta - Strings - green - Atoms - cyan - Comments - gray - Module names - yellow/orange - Numbers - orange **Actual behavior:** Everything appears in a single yellowish-green color with no syntax differentiation whatsoever. **Possible root cause:** May be related to how OpenCode TUI applies ANSI color codes when terminal has a custom color palette configured, or how it interacts with terminals managed by theme managers like Omarchy.
yindo added the opentuiperf labels 2026-02-16 18:10:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #3711: Syntax highlighting is broken (earlier report with similar symptoms)
  • #12266: Code highlight problem in tmux (highlighting issues in specific terminal environments)
  • #4236: Can't use custom themes that use ANSI colors (related to color palette and theme rendering)
  • #101: Use terminal theme colors by default (related to terminal theme color support)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #3711: Syntax highlighting is broken (earlier report with similar symptoms) - #12266: Code highlight problem in tmux (highlighting issues in specific terminal environments) - #4236: Can't use custom themes that use ANSI colors (related to color palette and theme rendering) - #101: Use terminal theme colors by default (related to terminal theme color support) Feel free to ignore if none of these address your specific case.
Author
Owner

@johanlunds commented on GitHub (Feb 14, 2026):

Maybe this has something to do with it (shown when enabling "console"; my problem specifically is Kotlin syntax highlighting not working):

[18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/tree-sitter-markdown-411r6y9b.wasm'
[18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/highlights-r812a2qc.scm'
[18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/injections-73j83es3.scm'
[18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/tree-sitter-markdown_inline-j5349f42.wasm'
[18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/highlights-x6tmsnaa.scm'
[18:06:36] [WARN] 'TSWorker:' 'No parser found for injection language: kotlin'

Version of OpenCode used: OpenCode 1.2.1

@johanlunds commented on GitHub (Feb 14, 2026): Maybe this has something to do with it (shown when enabling "console"; my problem specifically is Kotlin syntax highlighting not working): ``` [18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/tree-sitter-markdown-411r6y9b.wasm' [18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/highlights-r812a2qc.scm' [18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/injections-73j83es3.scm' [18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/tree-sitter-markdown_inline-j5349f42.wasm' [18:06:36] [LOG] 'TSWorker:' 'Loading from local path: /$bunfs/root/highlights-x6tmsnaa.scm' [18:06:36] [WARN] 'TSWorker:' 'No parser found for injection language: kotlin' ``` Version of OpenCode used: `OpenCode 1.2.1`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8612