Skip to content

Use of "[-:-:-]" resets to the terminal's background colour not TextView's background colour #520

@berrange

Description

@berrange

Consider the following code snippet:

package main

import (
	"github.com/rivo/tview"
)

func main() {
	app := tview.NewApplication()
	textView := tview.NewTextView().
		SetDynamicColors(true)
	textView.SetText("Hello [red:green:]world[-:-:-] again")
	if err := app.SetRoot(textView, true).Run(); err != nil {
		panic(err)
	}
}

I was expecting this to display "Hello" and "again" using the default TextView colour scheme producing white text on black backround, and "world" using red text, green background.

What actually happens though is that "again" is displayed white text, light gray background. The "white" text is the TextView colour scheme, but the "light gray" appears to be my terminal's default background colour.

Am I misunderstanding what "-" means? I was expecting it t reset to TextView's default background colour, not my terminal's default background colour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions