[GH-ISSUE #111] Feature Request: Add SetTextFlag() method #86

Closed
opened 2026-03-04 01:01:49 +03:00 by kerem · 1 comment
Owner

Originally created by @dtoubelis on GitHub (May 9, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/111

We are working on a TUI application that supposed to run on linux console. We discovered that gdamore/tcell library strictly adheres to terminal definitions on linux and only supports 8 colors by compressing 16 colors into 8 if necessary (for instance ColorYellow would become ColorOlive on linux console). I talked to Garrett about this here and I think this is actually desirable behavior.

This said, using all 16 colors can easily be achieved by using bold flag on most terminals. We actually currently use a workaround as follows for this:

table.SetCell(row, 0,
    tview.NewTableCell("[::b]URL:[::-]").
    SetTextColor(tcell.ColorGrey).
    SetAlign(tview.AlignRight))

So, would it be possible to add method for setting text flags on the cell in addition to color that the code above would become more like this:

table.SetCell(row, 0,
    tview.NewTableCell("URL:").
    SetTextColor(tcell.ColorGrey).
    SetTextFlags(Bold|Blink).
    SetAlign(tview.AlignRight))
Originally created by @dtoubelis on GitHub (May 9, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/111 We are working on a TUI application that supposed to run on linux console. We discovered that `gdamore/tcell` library strictly adheres to terminal definitions on linux and only supports 8 colors by compressing 16 colors into 8 if necessary (for instance `ColorYellow` would become `ColorOlive` on linux console). I talked to Garrett about this [here](https://github.com/gdamore/tcell/issues/217) and I think this is actually desirable behavior. This said, using all 16 colors can easily be achieved by using `bold` flag on most terminals. We actually currently use a workaround as follows for this: ```go table.SetCell(row, 0, tview.NewTableCell("[::b]URL:[::-]"). SetTextColor(tcell.ColorGrey). SetAlign(tview.AlignRight)) ``` So, would it be possible to add method for setting text flags on the cell in addition to color that the code above would become more like this: ```go table.SetCell(row, 0, tview.NewTableCell("URL:"). SetTextColor(tcell.ColorGrey). SetTextFlags(Bold|Blink). SetAlign(tview.AlignRight)) ```
kerem closed this issue 2026-03-04 01:01:49 +03:00
Author
Owner

@rivo commented on GitHub (May 15, 2018):

Yeah, makes sense. I added SetAttributes() and SetStyle() (as a shortcut to the three individual functions).

<!-- gh-comment-id:389199616 --> @rivo commented on GitHub (May 15, 2018): Yeah, makes sense. I added `SetAttributes()` and `SetStyle()` (as a shortcut to the three individual functions).
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#86
No description provided.