Skip column truncation when stdout is piped (non-TTY)#148
Conversation
When stdout is not a terminal (e.g. piped to grep, awk, cat), output full column values without truncation. This follows the standard CLI pattern used by docker ps, kubectl get, etc. - Table column truncation in PrintTableNoPad now checks IsTerminal - truncateURL also skips truncation in non-TTY mode - TTY behavior (truncate to terminal width) is unchanged Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: This PR modifies CLI output formatting in the browsers command, not the kernel API endpoints or Temporal workflows specified in the filter. To monitor this PR anyway, reply with |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b003810. Configure here.
| termWidth = 80 // fallback | ||
| // Only truncate columns when outputting to a terminal. | ||
| // When piped (non-TTY), output full values so grep/awk/etc. work correctly. | ||
| if term.IsTerminal(int(os.Stdout.Fd())) { |
There was a problem hiding this comment.
Duplicated TTY check instead of using new helper
Low Severity
PrintTableNoPad calls term.IsTerminal(int(os.Stdout.Fd())) inline at the same time the new IsStdoutTTY() helper — which does exactly the same thing — is introduced in the same file. The helper exists specifically to centralize this check and is already exported for use by cmd/browsers.go, but PrintTableNoPad doesn't use it. If the TTY detection logic ever changes, it would need updating in two places.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b003810. Configure here.


Summary
Fixes CLI table output truncation when stdout is piped to other tools (grep, awk, cat, etc.).
Before:
kernel browsers list | grep hypereturned nothing because URLs and other columns were truncated even in pipe mode.After:
This follows the standard CLI pattern used by
docker ps,kubectl get, etc.Changes
pkg/table/table.go: SkiptruncateTableDatawhen stdout is not a TTY; addIsStdoutTTY()helpercmd/browsers.go:truncateURLskips truncation in non-TTY modeTest plan
kernel browsers listin terminal — columns still truncate to fit widthkernel browsers list | cat— full URLs visible, no truncationkernel browsers list | grep <pattern>— matches found in full outputgo test ./...)Note
Low Risk
Low risk: changes are limited to CLI formatting behavior and only affect output when stdout is not a terminal (piped), with no impact on API calls or data mutation.
Overview
Stops truncating CLI output when stdout is piped (non-TTY) so full column values are preserved for tools like
grep/awk.pkg/table.PrintTableNoPadnow truncates columns only for terminal output and adds a sharedtable.IsStdoutTTY()helper;cmd/browsers.go’struncateURLalso skips truncation when not on a TTY.Reviewed by Cursor Bugbot for commit b003810. Bugbot is set up for automated code reviews on this repo. Configure here.