Skip to content

max width of markdown is hardcoded, should be configurable #9627

@smemsh

Description

@smemsh

Description

The maximum width of Markdown renders on the terminal (example: gh pr view output) is currently the lower of the actual terminal width or 120. It should have a configurable maximum rather than being hardcoded, for those of us that prefer narrower paragraphs.

Proposed solution

Suggest to check an environment variable for override of the 120 hardcode. If not present, the existing default 120 will be used. Alternative idea would be a gh config variable.

Environment variable is my preference as it's easy to put in one's shell profile, standard method for many terminal apps, and configures any system without having to run a config command on each one (the usual deposit of shell profile would happen anyways). An example of analogous variable is $MANWIDTH.

Suggested variable name is $GH_MDWIDTH. The GH_ prefix appears to be used by a few other environment variables already.

Additional context

A patch is proposed already at #9626. The previous hardcode of 80 was raised to 120 in #6016.

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