feat: clear screen before render so briefing starts at top

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) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 13:25:39 +02:00
parent 182644976c
commit 0b4e06eb04

View File

@@ -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