fix(module/shell): synchonous invocation was broken

For some (unknown) reason, redrawing while in the update loop breaks the
update (this probably warrants a closer look).

As a quickfix to restore functionality, remove the unnecessary redraw
call and move it into the async codepath, where it is actually needed.

fixes #1001
This commit is contained in:
tobi-wan-kenobi 2023-10-26 09:00:09 +02:00
parent 05622f985a
commit 025d3fcb51

View file

@ -53,6 +53,7 @@ class Module(core.module.Module):
def set_output(self, value):
self.__output = value
core.event.trigger("update", [self.id], redraw_only=True)
@core.decorators.scrollable
def get_output(self, _):
@ -62,7 +63,6 @@ class Module(core.module.Module):
# if requested then run not async version and just execute command in this thread
if not self.__async:
self.__output = util.cli.execute(self.__command, shell=True, ignore_errors=True).strip()
core.event.trigger("update", [self.id], redraw_only=True)
return
# if previous thread didn't end yet then don't do anything