Open smemsh opened 2 days ago
packages/eslint-plugin/src/configs/recommended.ts
One of my favorite debatable topics, @smemsh! 😆 In all seriousness, line length or text width is a genuine concern especially as lines longer than 80 characters have been considered as inaccessible by W3C.
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 $GHMDWIDTH. The GH prefix appears to be used by a few other environment variables already.
I agree if we adopted this we'd want to give users the ability to set it via env var or gh config
, also that we prefer prefixing our env vars to avoid conflicting with others.
How many commands rendering markdown are in scope?
All of the following commands render Markdown in different ways:
gh gist view
gh issue view
gh issue view --comments
gh pr create
gh pr review
gh pr view
gh pr view --comments
gh project view
gh reference
gh release view
gh repo view
gh workflow view
Is this contained to gh
or to any extension using cli/go-gh
?
Does this need to account for offset rendering?
Some of the commands above specify without indentation, however there are places where content is wrapped but it is indented.
For example, gh issue view https://github.com/cli/cli/issues/9627 --comments
will render the issue body as well as the comments, which are wrapped by text width and indented.
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
. TheGH_
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.