Skip to content

feat: prevent truncation of resource identifiers in table output #789

@michael-johnston

Description

@michael-johnston

Is your feature request related to a problem? Please describe.

When using ado get to list resources, the output table is fitted to the current terminal width by Rich. This causes column content to be truncated with ..., which makes it impossible to copy resource identifiers directly from the table — the primary reason most users run ado get.

The problem is compounded by flags like --details that add extra columns, increasing the chance of truncation even on wide terminals.

Describe the solution you'd like

Three complementary fixes, in order of priority:

  1. -o name output format — output only the resource identifier, one per line, with no table formatting. This is the lowest-friction fix for the scripting use case (copying IDs, piping to other commands) and follows the precedent set by kubectl get <resource> -o name.

  2. --no-trunc flag — when passed, disable all cell truncation in the output table. Columns will be rendered at their full content width,
    extending beyond the terminal width if necessary (the user can scroll horizontally). This follows the precedent set by docker ps --no-trunc
    .

  3. Never truncate the IDENTIFIER column by default — the identifier column should be marked no_wrap=True with a minimum width matching its content. Other columns (e.g. description, status) can still wrap or truncate gracefully. This silently fixes the most common complaint without requiring any flag.

Describe alternatives you've considered

  • -o wide format (kubectl-style) — a new output format that renders the full table without width constraints, intended to pair with --details. This is a reasonable alternative to --no-trunc and fits the existing -o convention, but is slightly higher cost to implement and less discoverable than a dedicated flag for users who just want full IDs.
  • Pager with horizontal scroll — automatically pipe wide output through less -S (or $PAGER) when the table exceeds terminal width. This is interactive-friendly but breaks non-interactive pipelines, requires TTY detection, and has platform edge cases. Worth considering as a follow-up but not recommended as the primary fix.
  • Workaround: -o yaml / -o json — users can already use these formats to retrieve full field values, but this is not discoverable and is far more verbose than needed just to copy an ID.

Additional context

The truncation is caused by Rich's Table fitting column widths to the Console's detected terminal width. The Console instances in orchestrator/cli/utils/output/prints.py are created without an explicit width, and dataframe_to_rich_table in orchestrator/utilities/rich.py
adds columns without no_wrap or min_width constraints. The overflow="ignore", crop=False passed at print time in console_print prevents cropping of the rendered output but does not affect the table's internal column allocation, which has already occurred.

The fix for -o name and --no-trunc is largely self-contained to AdoGetSupportedOutputFormats, handle_ado_get_default_format in
handlers.py, and dataframe_to_rich_table in utilities/rich.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions