Allow open to be asynchronous

This stops the ui being blocked while the resource is opened. The wait
ensures that resources are reclaimed when the process finishes while
aerc is still running.
This commit is contained in:
Andrew Jeffery 2020-07-06 20:14:15 +01:00 committed by Reto Brunner
parent 3e6189f243
commit fda3f43e7c
4 changed files with 29 additions and 8 deletions
commands/msgview

View file

@ -60,10 +60,9 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
return
}
err = lib.OpenFile(tmpFile.Name())
if err != nil {
lib.OpenFile(tmpFile.Name(), func(err error) {
aerc.PushError(" " + err.Error())
}
})
aerc.PushStatus("Opened", 10*time.Second)
})