From 0c2f2c9bb46a2703d0be10e198e0d9215fbc0096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 22 Dec 2025 10:52:21 +0100 Subject: [PATCH] frobar: More stuff I don't know anymore --- hm/desktop/frobar/frobar/common.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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))