diff --git a/hm/desktop/frobar/frobar/common.py b/hm/desktop/frobar/frobar/common.py index d4f0b05..3abd148 100644 --- a/hm/desktop/frobar/frobar/common.py +++ b/hm/desktop/frobar/frobar/common.py @@ -377,9 +377,9 @@ class Screen(ComposableText): proc.stdin.write(markup.encode()) try: await proc.stdin.drain() - except BrokenPipeError: - log.error("zelbar: broken pipe, killing") - proc.kill() + except (BrokenPipeError, ConnectionResetError): + log.exception("zelbar: broken pipe") + log.debug("proc.returncode = %s", str(proc.returncode)) return await self.refresh.wait() self.refresh.clear() @@ -399,8 +399,11 @@ class Screen(ComposableText): log.error("Unknown command: %s", command) continue callback() - log.error("zelbar: EOF reached, killing") - proc.kill() + log.error("zelbar: EOF reached") + # Sometimes EOF is reached while the process still runs, + # but more often the process dies before reaching here, + # so killing is (probably) not an option + log.debug("proc.returncode = %s", str(proc.returncode)) refresher_task = self.bar.add_long_running_task(refresher(proc)) action_handler_task = self.bar.add_long_running_task(action_handler(proc))