this is the smallest app that reliably reproduces this for me (in my real app I have the text view in a dynamically-sized flex item and it crashes when the terminal window is made too small):
$ go run .
panic: runtime error: index out of range [1] with length 1 [recovered]
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
/Users/richard/src/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230927091330-c961b0f0b9c5/application.go:251 +0x4d
panic({0x113f0c0, 0xc00009c018})
/usr/local/Cellar/go/1.20.4/libexec/src/runtime/panic.go:884 +0x213
github.com/rivo/tview.(*TextView).Draw(0xc00018c000, {0x117b010, 0xc00018e000})
/Users/richard/src/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230927091330-c961b0f0b9c5/textview.go:1263 +0xab1
github.com/rivo/tview.(*Flex).Draw(0xc000076840, {0x117b010?, 0xc00018e000})
/Users/richard/src/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230927091330-c961b0f0b9c5/flex.go:196 +0x34b
github.com/rivo/tview.(*Application).draw(0xc000188000)
/Users/richard/src/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230927091330-c961b0f0b9c5/application.go:612 +0x15a
github.com/rivo/tview.(*Application).Run(0xc000188000)
/Users/richard/src/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230927091330-c961b0f0b9c5/application.go:257 +0x13e
main.main()
/Users/richard/src/work/tview-crash/main.go:15 +0x213
exit status 2
this is the smallest app that reliably reproduces this for me (in my real app I have the text view in a dynamically-sized flex item and it crashes when the terminal window is made too small):
crashes with