Skip to content

feat(cli): TTY-aware table output#6

Open
slai11 wants to merge 1 commit intomainfrom
feat/tty-aware-table-output
Open

feat(cli): TTY-aware table output#6
slai11 wants to merge 1 commit intomainfrom
feat/tty-aware-table-output

Conversation

@slai11
Copy link

@slai11 slai11 commented Mar 18, 2026

Summary

  • Strip Rich box-drawing decorations (╭╰│) from table output when stdout is piped (not a TTY)
  • Move "Showing N rows" caption to stderr when piped, so it doesn't corrupt parseable output
  • Keep decorated table behavior when running interactively in a terminal

Test plan

  • uv run pytest tests/test_output.py -v — 4 tests pass
  • uv run ruff check . && uv run ruff format --check . — clean
  • Manual: allium realtime ... --format table | head produces clean undecorated output
  • Manual: allium realtime ... --format table in terminal shows decorated table

🤖 Generated with Claude Code

Detect TTY via sys.stdout.isatty(). When piped: use plain table (no
box-drawing chars), suppress caption from stdout, emit "Showing N rows"
to stderr instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant