fix(cli): expand session list columns for full ID visibility
Show complete session IDs in 'hermes sessions list' instead of truncating to 20 characters. Widens title column from 20→30 chars and adjusts header widths accordingly. Fixes #2068. Based on PR #2085 by @Nebula037 with a correction to preserve the no-titles layout (the original PR accidentally replaced the Preview/Src header with a duplicate Title/Preview header).
This commit is contained in:
parent
4d2c93a04f
commit
2f07df3177
1 changed files with 7 additions and 7 deletions
|
|
@ -3721,20 +3721,20 @@ For more help on a command:
|
||||||
return
|
return
|
||||||
has_titles = any(s.get("title") for s in sessions)
|
has_titles = any(s.get("title") for s in sessions)
|
||||||
if has_titles:
|
if has_titles:
|
||||||
print(f"{'Title':<22} {'Preview':<40} {'Last Active':<13} {'ID'}")
|
print(f"{'Title':<32} {'Preview':<40} {'Last Active':<13} {'ID'}")
|
||||||
print("─" * 100)
|
print("─" * 110)
|
||||||
else:
|
else:
|
||||||
print(f"{'Preview':<50} {'Last Active':<13} {'Src':<6} {'ID'}")
|
print(f"{'Preview':<50} {'Last Active':<13} {'Src':<6} {'ID'}")
|
||||||
print("─" * 90)
|
print("─" * 95)
|
||||||
for s in sessions:
|
for s in sessions:
|
||||||
last_active = _relative_time(s.get("last_active"))
|
last_active = _relative_time(s.get("last_active"))
|
||||||
preview = s.get("preview", "")[:38] if has_titles else s.get("preview", "")[:48]
|
preview = s.get("preview", "")[:38] if has_titles else s.get("preview", "")[:48]
|
||||||
if has_titles:
|
if has_titles:
|
||||||
title = (s.get("title") or "—")[:20]
|
title = (s.get("title") or "—")[:30]
|
||||||
sid = s["id"][:20]
|
sid = s["id"]
|
||||||
print(f"{title:<22} {preview:<40} {last_active:<13} {sid}")
|
print(f"{title:<32} {preview:<40} {last_active:<13} {sid}")
|
||||||
else:
|
else:
|
||||||
sid = s["id"][:20]
|
sid = s["id"]
|
||||||
print(f"{preview:<50} {last_active:<13} {s['source']:<6} {sid}")
|
print(f"{preview:<50} {last_active:<13} {s['source']:<6} {sid}")
|
||||||
|
|
||||||
elif action == "export":
|
elif action == "export":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue