From 0b4e06eb04b8d7e19e20e15db0cbf7b178323432 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 13 Apr 2026 13:25:39 +0200 Subject: [PATCH] feat: clear screen before render so briefing starts at top MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No more scrolling up after refresh — the screen clears and the calendar/summary is always visible at the top. Co-Authored-By: Claude Opus 4.6 (1M context) --- briefing | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/briefing b/briefing index 460b748..0a4a10a 100755 --- a/briefing +++ b/briefing @@ -7,7 +7,7 @@ Usage: briefing [7|30] [client] briefing 7 OHS — 7-day, OHS only """ -import json, sys, subprocess, re, readline +import json, sys, subprocess, re, readline, os from datetime import datetime, timezone, timedelta API_KEY = "b666180ef00fffd23b9a606a4bd8deddea274d2e69fab975583d3d966fbfafed" @@ -455,6 +455,10 @@ def fetch_and_render(range_days, client): if client: url += f"&client={client}" + # Clear screen so briefing always starts at top + if sys.stdout.isatty(): + print("\033[2J\033[H", end="", flush=True) + result = subprocess.run( ["curl", "-s", "-H", f"Authorization: Bearer {API_KEY}", url], capture_output=True, text=True