[GH-ISSUE #521] Form border lines are rendered white on white since tcell update #381

Closed
opened 2026-03-04 01:04:29 +03:00 by kerem · 7 comments
Owner

Originally created by @berrange on GitHub (Nov 5, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/521

If I build the 'demos/form/main.go' demo program and run, the form used to have a double line border around it with background in black and lines in white, along with the title text in white.

Since the update to tcell in

commit e4d167311d7708471e449a05b3d1c9dfb061abfc (HEAD)
Author: Oliver <oliver@stockperformer.com>
Date:   Sun Oct 18 14:15:57 2020 +0200

    Upgraded to latest tcell version. Results in a minor incompatibility in the Table class.```

The form now does not render the border correctly, both the background and lines and the text are all in white.
Originally created by @berrange on GitHub (Nov 5, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/521 If I build the 'demos/form/main.go' demo program and run, the form used to have a double line border around it with background in black and lines in white, along with the title text in white. Since the update to tcell in ``` commit e4d167311d7708471e449a05b3d1c9dfb061abfc (HEAD) Author: Oliver <oliver@stockperformer.com> Date: Sun Oct 18 14:15:57 2020 +0200 Upgraded to latest tcell version. Results in a minor incompatibility in the Table class.``` The form now does not render the border correctly, both the background and lines and the text are all in white.
kerem closed this issue 2026-03-04 01:04:30 +03:00
Author
Owner

@rivo commented on GitHub (Nov 17, 2020):

I cannot reproduce this with the latest version:

image

Which terminal / OS are you using?

<!-- gh-comment-id:729140717 --> @rivo commented on GitHub (Nov 17, 2020): I cannot reproduce this with the latest version: ![image](https://user-images.githubusercontent.com/480930/99435686-c36f5100-2910-11eb-8018-a05d2cf87b33.png) Which terminal / OS are you using?
Author
Owner

@berrange commented on GitHub (Nov 18, 2020):

This is with latest tview source, cloned right now, and then building from the git root

$ go build demos/form/main.go 
go: downloading github.com/rivo/uniseg v0.2.0
go: extracting github.com/rivo/uniseg v0.2.0
go: downloading github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591
go: extracting github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591
go: downloading golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7
go: downloading golang.org/x/text v0.3.3
go: extracting golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7
go: extracting golang.org/x/text v0.3.3
go: finding github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591
go: finding golang.org/x/text v0.3.3
go: finding golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7
go: finding github.com/rivo/uniseg v0.2.0
$ ./main

I'm using Fedora 33, x86_64, with GNOME Terminal (gnome-terminal-3.38.1-1.fc33.x86_64).

Normally I'm using a white-ish background, and black text, but for this screenshot I've set my terminal background to pink, to make it obvious that the borders are inheriting the terminal's default background colour instead of any tview colour theme:

tview-borders

<!-- gh-comment-id:729550870 --> @berrange commented on GitHub (Nov 18, 2020): This is with latest tview source, cloned right now, and then building from the git root ``` $ go build demos/form/main.go go: downloading github.com/rivo/uniseg v0.2.0 go: extracting github.com/rivo/uniseg v0.2.0 go: downloading github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591 go: extracting github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591 go: downloading golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7 go: downloading golang.org/x/text v0.3.3 go: extracting golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7 go: extracting golang.org/x/text v0.3.3 go: finding github.com/gdamore/tcell/v2 v2.0.1-0.20201017141208-acf90d56d591 go: finding golang.org/x/text v0.3.3 go: finding golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7 go: finding github.com/rivo/uniseg v0.2.0 $ ./main ``` I'm using Fedora 33, x86_64, with GNOME Terminal (gnome-terminal-3.38.1-1.fc33.x86_64). Normally I'm using a white-ish background, and black text, but for this screenshot I've set my terminal background to pink, to make it obvious that the borders are inheriting the terminal's default background colour instead of any tview colour theme: ![tview-borders](https://user-images.githubusercontent.com/1517315/99510960-93ab6200-297f-11eb-99f2-6a0903767180.png)
Author
Owner

@joegrasse commented on GitHub (Mar 4, 2021):

I am also running into this issue. With me though, it is anything that has a boarder. I can set the color of the border line with SetBorderColor, but there is actually a color behind (around) the line that matches the terminal color (black).

Here is another example.

// Demo code for the Box primitive.
package main

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

func main() {
	box := tview.NewBox().
		SetBackgroundColor(tcell.ColorGreen).
		SetTitle("Hello").
		SetBorder(true).
		SetBorderPadding(0, 0, 0, 0).
		SetBorderColor(tcell.ColorWhite)

	if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil {
		panic(err)
	}
}

image

<!-- gh-comment-id:790610732 --> @joegrasse commented on GitHub (Mar 4, 2021): I am also running into this issue. With me though, it is anything that has a boarder. I can set the color of the border line with `SetBorderColor`, but there is actually a color behind (around) the line that matches the terminal color (black). Here is another example. ```Go // Demo code for the Box primitive. package main import ( "github.com/gdamore/tcell/v2" "github.com/rivo/tview" ) func main() { box := tview.NewBox(). SetBackgroundColor(tcell.ColorGreen). SetTitle("Hello"). SetBorder(true). SetBorderPadding(0, 0, 0, 0). SetBorderColor(tcell.ColorWhite) if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil { panic(err) } } ``` ![image](https://user-images.githubusercontent.com/4334144/109969357-6cbc3600-7cb9-11eb-94cb-d5cd56431c0f.png)
Author
Owner

@rivo commented on GitHub (Mar 12, 2021):

Please check out https://github.com/rivo/tview/issues/520#issuecomment-797659408 and let me know if the latest version resolves your issue.

<!-- gh-comment-id:797661167 --> @rivo commented on GitHub (Mar 12, 2021): Please check out https://github.com/rivo/tview/issues/520#issuecomment-797659408 and let me know if the latest version resolves your issue.
Author
Owner

@mevdschee commented on GitHub (Mar 13, 2021):

image

@joegrasse Seems fixed to me.

<!-- gh-comment-id:797884460 --> @mevdschee commented on GitHub (Mar 13, 2021): ![image](https://user-images.githubusercontent.com/1288217/111023189-ecdc4d00-83d7-11eb-891f-72bac661b8eb.png) @joegrasse Seems fixed to me.
Author
Owner

@rivo commented on GitHub (Mar 13, 2021):

Great! Thanks for the feedback!

<!-- gh-comment-id:798788776 --> @rivo commented on GitHub (Mar 13, 2021): Great! Thanks for the feedback!
Author
Owner

@joegrasse commented on GitHub (Mar 15, 2021):

Yes, fixed for me as well.

<!-- gh-comment-id:799342013 --> @joegrasse commented on GitHub (Mar 15, 2021): Yes, fixed for me as well.
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#381
No description provided.