Skip to content

Feature Request: Fix table border rendering - box-drawing characters appear disconnected #12164

@onesuit

Description

@onesuit

Summary

Fix markdown table border rendering where box-drawing characters appear disconnected/broken instead of forming clean connected lines.

Problem

Currently, OpenCode renders markdown tables with box-drawing characters (┌│┐─┼) via Glamour. However, these characters render as disconnected segments in many terminal environments, making tables very difficult to read.

Current Rendering (Broken/Disconnected)

Table rendering issue

The box-drawing characters appear as separate fragments:

┌ ─ ─ ─ ┬ ─ ─ ─ ┐
│       │       │
├ ─ ─ ─ ┼ ─ ─ ─ ┤

Instead of properly connected lines like this:

┌───────┬───────┐
│       │       │
├───────┼───────┤

Desired: Rich-style Connected Borders

Python's Rich library renders tables with properly connected borders that look clean:

┌─────────┬──────┬─────────┐
│ Name    │ Age  │ Status  │
├─────────┼──────┼─────────┤
│ Alice   │ 30   │ Active  │
│ Bob     │ 25   │ Pending │
└─────────┴──────┴─────────┘

Root Cause Analysis

This appears to be related to how Glamour renders table borders - possibly:

  1. Character spacing issues between box-drawing characters
  2. Font rendering inconsistencies with Unicode box-drawing
  3. ANSI escape sequence handling that breaks character connections

Proposed Solutions

Option 1: Fix Glamour Integration

Ensure box-drawing characters are rendered adjacently without spacing issues.

Option 2: Alternative Table Renderer

Consider using a table rendering approach similar to:

  • Rich (Python) - uses rich.table.Table with proper border handling
  • Lipgloss tables - Charm's Go library with proper border rendering

Option 3: Configuration Option

Add a tui.table_renderer option:

{
  "$schema": "https://opencode.ai/config.json",
  "tui": {
    "table_renderer": "rich"  // or "glamour", "lipgloss"
  }
}

Use Cases

  1. Data-heavy workflows: DevOps/SA work involves many comparison tables
  2. Readability: Connected borders are essential for distinguishing columns
  3. Professional output: Current broken rendering looks unprofessional

Environment

  • OpenCode version: Latest
  • OS: macOS
  • Terminal: Various (WezTerm, iTerm2, etc.)
  • The issue persists across different terminal emulators

References

Additional Context

This significantly impacts user experience when working with LLM outputs containing structured data tables. The disconnected borders make it hard to follow rows and columns, especially in multi-column tables.

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions