Skip to content

Automatically adjust output to the width of the terminal #39

Description

@JeroenSoeters

What problem does this solve?

When the width of the terminal gets too small, formae rendering breaks. This manifests:

  • in the formae logo banner, which gets wrapped around to the next line
  • in the table for the status output (summary), which also wraps

Proposed solution

Open to any solutions here. The tablewriter library we use supports a MaxWidth. We could potentially handle theSIGWINCH (using os/signal) to detect whether the terminal size has changed. The golang.org/x/term package should give us the terminal's current width and height so we can then redraw accordingly.

We could potentially warp the banner in a table as well to defer truncating to the library. Open for any suggestions here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions