-
Notifications
You must be signed in to change notification settings - Fork 964
Open
Description
Describe the bug
If you rename or delete file that is listed with filepicker module it will panic and there is no way to handle it correctly.
I am working on MacOS.
I tried to add recover to my View(), but then there is no way to re-render the view and the page will be blank.
func (m model) View() string {
defer func() {
if r := recover(); r != nil {
fmt.Fprintln(os.Stderr, "Caught panic in filepicker.View:", r)
// recreate filepicker
m.setupFilePicker()
// TODO how to force tea to redraw the view after panic?
}
}()
// ....
To Reproduce
Steps to reproduce the behavior:
- create file
test.txt
in home - run
examples/file-picker/main.go
, you will see list of files in your home - rename or delete file
test.txt
you created with file manager or shell - press arrow key down to move in the list
- the example will panic
Expected behavior
It should not crash, or there should be at least possibility to handle this panic in tea view.
Metadata
Metadata
Assignees
Labels
No labels