Skip to content

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

Closed

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

Activity

  1. janluke commented on Jan 22, 2021

    @janluke
  2. davidism commented on Jan 22, 2021

    @davidism
  3. janluke commented on Jan 22, 2021

    @janluke
  4. added this to the 8.0.0 milestone on Feb 15, 2021
  5. locked as resolved and limited conversation to collaborators on Mar 2, 2021
  6. added
    parsingParsing, parameters, commands, chaining, context
    on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    parsingParsing, parameters, commands, chaining, context

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions