Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help text wrapping set to 80 irrespective of the terminal width #2253

Closed
couling opened this issue Apr 13, 2022 · 2 comments · Fixed by #2432
Closed

Help text wrapping set to 80 irrespective of the terminal width #2253

couling opened this issue Apr 13, 2022 · 2 comments · Fixed by #2432
Labels

Comments

@couling
Copy link
Contributor

couling commented Apr 13, 2022

According to the documentation click should:

The default behavior of Click is to rewrap text based on the width of the terminal

At least on a mac terminal, that's not the case. For me, the output of shutil.get_terminal_size() is os.terminal_size(columns=210, lines=44). But click is wrapping all text to 80 characters and does not respond to resizes of the terminal before or during the program's execution.

This is a little jarring and it would be nice if this could either dynamically resize or offer a way to manually set it.

Environment:

  • Python version: 3.9
  • Click version: 8.1.2
@davidism
Copy link
Member

The default max width is 80 characters, which is pretty standard for help output and ensures a readable flow of text even at large widths. It can be changed by setting Context.max_content_width. For example:

@click.command
def cli():
    ...

cli(max_content_width=120)

@couling
Copy link
Contributor Author

couling commented Apr 28, 2022

@davidism just to clarify, do you intend to correct the documentation on this?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2022
@davidism davidism added the docs label Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants