basetabs: wrap coroutine commands in ensure_future

This commit is contained in:
mathieui 2021-01-29 14:55:05 +01:00 committed by Link Mauve
parent 695b2ee09a
commit 93c448506a

View file

@ -324,7 +324,10 @@ class Tab:
if func:
if hasattr(self.input, "reset_completion"):
self.input.reset_completion()
func(arg)
if asyncio.iscoroutinefunction(func):
asyncio.ensure_future(func(arg))
else:
func(arg)
return True
else:
return False