[GH-ISSUE #1121] Special character rendered incorrect in Table #811

Open
opened 2026-03-04 01:07:55 +03:00 by kerem · 2 comments
Owner

Originally created by @ydzhou on GitHub (Sep 19, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1121

Special characters such as do not get rendered in the Table Cell if font color is set to light. However, if I set the font color to be black, it gets rendered.

The 1st image is the one that the whole table cell does not get rendered, the 2nd image is the one that table cell gets rendered if I set the font color to be black.

The issue seems only on Table component. I do not see the same issue with TextView at least

Image Image
Originally created by @ydzhou on GitHub (Sep 19, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1121 Special characters such as `/` do not get rendered in the Table Cell if font color is set to light. However, if I set the font color to be black, it gets rendered. The 1st image is the one that the whole table cell does not get rendered, the 2nd image is the one that table cell gets rendered if I set the font color to be black. The issue seems only on Table component. I do not see the same issue with TextView at least <img width="525" height="47" alt="Image" src="https://github.com/user-attachments/assets/8659e80d-f49d-4cc4-bc33-1568a273665a" /> <img width="646" height="42" alt="Image" src="https://github.com/user-attachments/assets/1d5da220-4fa1-43c1-b0aa-67fb342dd4a6" />
Author
Owner

@rivo commented on GitHub (Sep 27, 2025):

Please include a brief code snippet that allows me to reproduce this issue.

<!-- gh-comment-id:3341564526 --> @rivo commented on GitHub (Sep 27, 2025): Please include a brief code snippet that allows me to reproduce this issue.
Author
Owner

@ydzhou commented on GitHub (Sep 28, 2025):

Please see blow example. I found out the issue is probably more leaning towards [ and ] instead of previous special character .

package main

import (
	"github.com/rivo/tview"
	"github.com/gdamore/tcell/v2"
)

func main() {
	app := tview.NewApplication()
	table := tview.NewTable().
	SetBorders(true)
	content := []string{"Name", "[WEB][ABC][SINGLE][Tom & Bob][123][SAMPLE]"}
	for r := 0; r < len(content); r++ {
			table.SetCellSimple(r, 0, content[r])
	}
	table.Select(0, 0).SetDoneFunc(func(key tcell.Key) {
		if key == tcell.KeyEscape {
			app.Stop()
		}
		if key == tcell.KeyEnter {
			table.SetSelectable(true, true)
		}
	}).SetSelectedFunc(func(row int, column int) {
		table.GetCell(row, column).SetTextColor(tcell.ColorRed)
		table.SetSelectable(false, false)
	})
	if err := app.SetRoot(table, true).SetFocus(table).Run(); err != nil {
		panic(err)
	}
}
<!-- gh-comment-id:3344221563 --> @ydzhou commented on GitHub (Sep 28, 2025): Please see blow example. I found out the issue is probably more leaning towards `[` and `]` instead of previous special character `/`. ``` package main import ( "github.com/rivo/tview" "github.com/gdamore/tcell/v2" ) func main() { app := tview.NewApplication() table := tview.NewTable(). SetBorders(true) content := []string{"Name", "[WEB][ABC][SINGLE][Tom & Bob][123][SAMPLE]"} for r := 0; r < len(content); r++ { table.SetCellSimple(r, 0, content[r]) } table.Select(0, 0).SetDoneFunc(func(key tcell.Key) { if key == tcell.KeyEscape { app.Stop() } if key == tcell.KeyEnter { table.SetSelectable(true, true) } }).SetSelectedFunc(func(row int, column int) { table.GetCell(row, column).SetTextColor(tcell.ColorRed) table.SetSelectable(false, false) }) if err := app.SetRoot(table, true).SetFocus(table).Run(); err != nil { panic(err) } } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#811
No description provided.