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:
6
briefing
6
briefing
@@ -7,7 +7,7 @@ Usage: briefing [7|30] [client]
|
|||||||
briefing 7 OHS — 7-day, OHS only
|
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
|
from datetime import datetime, timezone, timedelta
|
||||||
|
|
||||||
API_KEY = "b666180ef00fffd23b9a606a4bd8deddea274d2e69fab975583d3d966fbfafed"
|
API_KEY = "b666180ef00fffd23b9a606a4bd8deddea274d2e69fab975583d3d966fbfafed"
|
||||||
@@ -455,6 +455,10 @@ def fetch_and_render(range_days, client):
|
|||||||
if client:
|
if client:
|
||||||
url += f"&client={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(
|
result = subprocess.run(
|
||||||
["curl", "-s", "-H", f"Authorization: Bearer {API_KEY}", url],
|
["curl", "-s", "-H", f"Authorization: Bearer {API_KEY}", url],
|
||||||
capture_output=True, text=True
|
capture_output=True, text=True
|
||||||
|
|||||||
Reference in New Issue
Block a user