Skip to main content

render_session_table

Function render_session_table 

Source
pub fn render_session_table(sessions: &[Session]) -> String
Expand description

Render a fixed-width table of sessions for tcode session list.

Why: session.list’s raw JSON is unreadable at a glance; operators want id/status/task/agent at one line each. What: one header line + one row per session, columns ID | STATUS | AGENT | TASK (task truncated to keep rows terminal-width friendly). An empty list renders a single explanatory line, not an empty string, so scripts piping through a pager see something. Test: tests::render_session_table_lists_every_session, tests::render_session_table_handles_empty_list.