Skip to content

Deprecate click.get_terminal_size() in favor of stdlib shutil.get_terminal_size() #1736

@jdufresne

Description

@jdufresne

Since Python 3.3, the stdlib provides the function shutil.get_terminal_size(). Now that the project has dropped Python 2
support, the compatibility shim is no longer necessary.

The stdlib version returns a named tuple. So rather than indexing "0", can use the more self-documenting attribute "columns".

Docs available at: https://docs.python.org/3/library/shutil.html#shutil.get_terminal_size

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions