#880·tview

tview application freezes with AddTextView form component specific configuration and keystroke capture

Author: WeBtOrY-ESCreated Sep 4, 2023Updated Aug 9, 2026

Hi!

After injecting application and form as a parameters of a function tview.NewApplication(),tview.NewForm() as application *tview.Application, form *tview.Form

when you use this configuration of AddTextView

form.AddTextView("Server name", serverName, 20, 1, false, false)

and the Esc key is pressed

(captured with this code)

application.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { k := event.Key() if k == tcell.KeyEsc { escPressed = true application.Stop() } return event })

the application freezes.

However, with this configuration of AddTextView is used

form.AddTextView("Server name", serverName, 20, 1, false, true)

the application behaves as it should.

I don't know if is a expected behavior or is a bug.