package main
import (
"os"
"os/exec"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
)
func crash() int {
my_list := []int{1, 2, 3}
return my_list[5]
}
func main() {
app := tview.NewApplication()
app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
k := event.Key()
if k == tcell.KeyEnter {
go crash()
}
return event
})
box := tview.NewBox().SetBorder(true).SetTitle("Hello, world!")
if err := app.SetRoot(box, true).Run(); err != nil {
panic(err)
}
}