Markdown tables display as plain text instead of formatted tables #2542

Closed
opened 2026-02-16 17:36:09 -05:00 by yindo · 11 comments
Owner

Originally created by @falcon-head on GitHub (Nov 3, 2025).

Originally assigned to: @kommander on GitHub.

Description

Description

When OpenCode generates a response containing markdown table syntax, the tables are not being rendered as formatted ASCII/text tables in the terminal output. Instead, the raw markdown syntax is displayed.

Expected Behavior

When the AI assistant outputs a comparison table or any tabular data, it should render as a properly formatted text-based table with borders and alignment in the terminal.

Actual Behavior

The raw markdown table syntax is displayed as-is in the terminal, making it difficult to read the comparison data.

Additional Context

  • Tested with GitHub Copilot provider
  • Using OpenCode version 1.0.16
  • Mac OS 26.0.1 with Kitty terminal

OpenCode version

1.0.16

Steps to reproduce

  1. Go to model selector
  2. Select any model that you have active subscription to (tested with GitHub Copilot)
  3. Ask it to output a comparison table (e.g., "compare GPT-4 vs Claude")
  4. Raw markdown text gets displayed instead of formatted table

Screenshot and/or share link

Image

Operating System

Mac os 26.0.1

Terminal

Kitty terminal

Originally created by @falcon-head on GitHub (Nov 3, 2025). Originally assigned to: @kommander on GitHub. ### Description ## Description When OpenCode generates a response containing markdown table syntax, the tables are not being rendered as formatted ASCII/text tables in the terminal output. Instead, the raw markdown syntax is displayed. ### Expected Behavior When the AI assistant outputs a comparison table or any tabular data, it should render as a properly formatted text-based table with borders and alignment in the terminal. ### Actual Behavior The raw markdown table syntax is displayed as-is in the terminal, making it difficult to read the comparison data. ### Additional Context - Tested with GitHub Copilot provider - Using OpenCode version 1.0.16 - Mac OS 26.0.1 with Kitty terminal ### OpenCode version 1.0.16 ### Steps to reproduce 1. Go to model selector 2. Select any model that you have active subscription to (tested with GitHub Copilot) 3. Ask it to output a comparison table (e.g., "compare GPT-4 vs Claude") 4. Raw markdown text gets displayed instead of formatted table ### Screenshot and/or share link <img width="2069" height="434" alt="Image" src="https://github.com/user-attachments/assets/a74f253f-20ed-4e0a-8231-d3744f21b222" /> ### Operating System Mac os 26.0.1 ### Terminal Kitty terminal
yindo added the opentuibug labels 2026-02-16 17:36:09 -05:00
yindo closed this issue 2026-02-16 17:36:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 3, 2025):

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

  • #2166: Reports markdown table rendering inconsistencies and asks about theming support for table display

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

@github-actions[bot] commented on GitHub (Nov 3, 2025): This issue might be a duplicate of existing issues. Please check: - #2166: Reports markdown table rendering inconsistencies and asks about theming support for table display Feel free to ignore if none of these address your specific case.
Author
Owner

@maxandron commented on GitHub (Nov 11, 2025):

Hi, I started tinkering as this issue was bothering me recently. I'll be happy to take a crack at it, but there is a design decision to make here, both in regards to styling and in regards to handling of tables that overflow

In general I thought to follow a similar direction to the way markdown renders work in nvim.
Turning something like this:

Image

To this:

Image

The problem is with large tables.

In raw form they currently render like this: (messed up but somewhat readable)

Image

One possible direction to take here is to truncate columns based on the terminal's width:

Image

But then that require "teaching" the user to turn off code concealement to see the full text (which can be added as a hint below a truncated table)

But maybe there is a better direction I'm missing. I thought of horizontal scrolling but that seems very unintuitive (and I'm not sure how well it works in terminals).
Another option is just to truncate whole columns and leave only the first and last columns - but that feels too disruptive and will force the user to turn off concealement every time.

In regards to styling - I honestly like the plain style. But I can see a potential to extend the themes with colors and styles for headings, seperators, etc.

Anyways - I'm just playing around. If you would like me to continue in this direction and open a PR, let me know and I'll be happy to help.

@maxandron commented on GitHub (Nov 11, 2025): Hi, I started tinkering as this issue was bothering me recently. I'll be happy to take a crack at it, but there is a design decision to make here, both in regards to styling and in regards to handling of tables that overflow In general I thought to follow a similar direction to the way markdown renders work in nvim. Turning something like this: <img width="514" height="338" alt="Image" src="https://github.com/user-attachments/assets/466aff43-c323-409a-924f-d76bb29d52a0" /> To this: <img width="549" height="382" alt="Image" src="https://github.com/user-attachments/assets/d20e3b23-b7ec-4969-b8b5-16589aac53ae" /> The problem is with large tables. In raw form they currently render like this: (messed up but somewhat readable) <img width="1129" height="551" alt="Image" src="https://github.com/user-attachments/assets/b49e92f2-e969-47da-8ba1-2f3fd96da17a" /> One possible direction to take here is to truncate columns based on the terminal's width: <img width="1168" height="439" alt="Image" src="https://github.com/user-attachments/assets/91248713-2a30-4a86-9a13-7750d2e54cea" /> But then that require "teaching" the user to turn off code concealement to see the full text (which can be added as a hint below a truncated table) But maybe there is a better direction I'm missing. I thought of horizontal scrolling but that seems very unintuitive (and I'm not sure how well it works in terminals). Another option is just to truncate whole columns and leave only the first and last columns - but that feels too disruptive and will force the user to turn off concealement every time. In regards to styling - I honestly like the plain style. But I can see a potential to extend the themes with colors and styles for headings, seperators, etc. Anyways - I'm just playing around. If you would like me to continue in this direction and open a PR, let me know and I'll be happy to help.
Author
Owner

@grigio commented on GitHub (Nov 17, 2025):

+1 probably the best way to implement it is to toggle with a shortcut the markdown/text rendering

@grigio commented on GitHub (Nov 17, 2025): +1 probably the best way to implement it is to toggle with a shortcut the markdown/text rendering
Author
Owner

@H0llyW00dzZ commented on GitHub (Dec 2, 2025):

+1

@H0llyW00dzZ commented on GitHub (Dec 2, 2025): +1
Author
Owner

@remorses commented on GitHub (Dec 2, 2025):

Working on a PR in opentui https://github.com/sst/opentui/pull/369

@remorses commented on GitHub (Dec 2, 2025): Working on a PR in opentui https://github.com/sst/opentui/pull/369
Author
Owner

@66Leo66 commented on GitHub (Dec 4, 2025):

Image

Seems like copilot cli can't handle overflowing tables as well. In this case, I wonder if it's technically possible to let table occupy full width(or not) and then wrap lines in cells. Like how glow does it:

Image
@66Leo66 commented on GitHub (Dec 4, 2025): <img width="2560" height="1486" alt="Image" src="https://github.com/user-attachments/assets/dcf00268-3ac4-48f3-8f97-2ef5c29be02f" /> Seems like copilot cli can't handle overflowing tables as well. In this case, I wonder if it's technically possible to let table occupy full width(or not) and then wrap lines in cells. Like how glow does it: <img width="1821" height="1487" alt="Image" src="https://github.com/user-attachments/assets/23dca815-d921-418d-8e66-2d4d9c408b9d" />
Author
Owner

@Regboy744 commented on GitHub (Dec 18, 2025):

Hi, does anyone found out how to fix this bug on the table rendering ? It is been there for a while. thanks

@Regboy744 commented on GitHub (Dec 18, 2025): Hi, does anyone found out how to fix this bug on the table rendering ? It is been there for a while. thanks
Author
Owner

@eivamu commented on GitHub (Dec 19, 2025):

Same issue.

Example output:

Image

Example of what it should look like imo:

Image

Environment: Multiple (both native Linux clients + Windows 11 with WSL), both when running locally and when running on a different host (ssh). OpenCode 1.0.168 with Claude.

Would be fantastic if this was fixed.

@eivamu commented on GitHub (Dec 19, 2025): Same issue. Example output: <img width="1687" height="870" alt="Image" src="https://github.com/user-attachments/assets/645fe75e-7705-4610-acc4-e7981d478fc0" /> Example of what _it should look like_ imo: <img width="1681" height="1142" alt="Image" src="https://github.com/user-attachments/assets/004d5785-2f5b-45ec-9921-8987a61a58e1" /> **Environment**: Multiple (both native Linux clients + Windows 11 with WSL), both when running locally and when running on a different host (ssh). OpenCode 1.0.168 with Claude. Would be fantastic if this was fixed.
Author
Owner

@eivamu commented on GitHub (Dec 19, 2025):

Temporary workaround

Until a fix is implemented, I have created a workaround based on my previous comment. Instruct your agents to pad table contents with something like this:

When outputting markdown tables, always pad cell contents so that all cells in the same column have exactly the same character width.

I've added it myself to my CLAUDE.md.

@eivamu commented on GitHub (Dec 19, 2025): ### Temporary workaround Until a fix is implemented, I have created a workaround based on my previous comment. Instruct your agents to pad table contents with something like this: > `When outputting markdown tables, always pad cell contents so that all cells in the same column have exactly the same character width.` I've added it myself to my `CLAUDE.md`.
Author
Owner

@66Leo66 commented on GitHub (Dec 19, 2025):

Temporary workaround

Until a fix is implemented, I have created a workaround based on my previous comment. Instruct your agents to pad table contents with something like this:

When outputting markdown tables, always pad cell contents so that all cells in the same column have exactly the same character width.

I've added it myself to my CLAUDE.md.

I think there's https://github.com/franlol/opencode-md-table-formatter for that.

@66Leo66 commented on GitHub (Dec 19, 2025): > ### Temporary workaround > Until a fix is implemented, I have created a workaround based on my previous comment. Instruct your agents to pad table contents with something like this: > > > `When outputting markdown tables, always pad cell contents so that all cells in the same column have exactly the same character width.` > > I've added it myself to my `CLAUDE.md`. I think there's https://github.com/franlol/opencode-md-table-formatter for that.
Author
Owner

@eivamu commented on GitHub (Dec 19, 2025):

I think there's https://github.com/franlol/opencode-md-table-formatter for that.

Fantastic, thanks! I didn't fancy the output for the separator in tables too much, so I forked it and created my own to mimic my desired output from the latest screenshot above.

https://github.com/eivamu/opencode-md-table-formatter

@eivamu commented on GitHub (Dec 19, 2025): > I think there's https://github.com/franlol/opencode-md-table-formatter for that. Fantastic, thanks! I didn't fancy the output for the separator in tables too much, so I forked it and created my own to mimic my desired output from the latest screenshot above. https://github.com/eivamu/opencode-md-table-formatter
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2542