Skip to content

[BUG] Table output columns break when content exceeds terminal width #201

@nadavs123

Description

@nadavs123

Bug Description

Description

When print_output_format renders a table with show_headers=True and the total row width exceeds the terminal width, columns are pushed off-screen and wrap to the next line. This makes the output appear as if columns have disappeared: headers show on one line, some values appear on the next line, and the table alignment is completely lost.

fabric-cli version

1.3.1

Python version

Python 3.12.10

Operating System

Windows

CLI Mode

Interactive mode

Authentication Method

Interactive browser login

Steps to Reproduce

  1. Use a command like ls or find that supports table rendering
  2. Get a response with long values

Expected Behavior

Table columns should fit within the terminal width. Long values in columns should be truncated with ... to prevent the table from exceeding the terminal width.

Actual Behavior

When a page contains column with long values, the table row exceeds the terminal width. This causes:

  • Headers are pushed to the far right edge or off-screen
  • Values to wrap to a second line
  • The table to appear as if columns are missing

Additional Context

This affects all commands that use print_output_format with show_headers=True.

Possible Solution

  • The find command already truncates description in compact mode using shutil.get_terminal_size(). A similar approach could be applied to other columns like name.
  • A more robust fix would be terminal-width-aware column sizing in the shared table renderer (_print_output_format_result_text).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions