{"id":19511674,"url":"https://github.com/thecodetherapy/terminal_size","last_synced_at":"2025-10-09T12:44:17.002Z","repository":{"id":149947376,"uuid":"168240133","full_name":"TheCodeTherapy/terminal_size","owner":"TheCodeTherapy","description":"Small Python snippet that aims to detect your terminal emulator dimensions on any platform (Windows, Mac, Linux, tput, CYGWIN, your toaster, etc.)","archived":false,"fork":false,"pushed_at":"2019-01-29T22:35:16.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-08T11:49:24.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheCodeTherapy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-29T22:33:49.000Z","updated_at":"2019-01-29T22:35:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d9fc5fc-2f45-4ec1-9491-17e931d4f53a","html_url":"https://github.com/TheCodeTherapy/terminal_size","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodeTherapy%2Fterminal_size","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodeTherapy%2Fterminal_size/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodeTherapy%2Fterminal_size/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCodeTherapy%2Fterminal_size/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheCodeTherapy","download_url":"https://codeload.github.com/TheCodeTherapy/terminal_size/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240761141,"owners_count":19853256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T23:22:13.440Z","updated_at":"2025-10-09T12:44:16.914Z","avatar_url":"https://github.com/TheCodeTherapy.png","language":"Python","readme":"# terminal_size\n\n## What?\nterminal_size is a small Python snippet that aims to detect any terminal emulator size on any platform (Windows, Mac, Linux, tput, CYGWIN, your toaster, etc.). If successful, its main function **get_terminal_size()** returns a tuple composed by two values, representing respectively the width and the height of the terminal emulator in which your code is running.\n\n## How?\nUsage:\n\n```\nfrom terminal_size import get_terminal_size\nterm_size = get_terminal_size()\n```\n\nThe types returned to term_size in the usage case above can be **tuple** (if size was successfully detected) or **None** (in case the code could not detect the dimensions successfully).\nYou can test its return with:\n\n```\nisinstance(term_size, tuple) and len(term_size) == 2\n```\n\nAny other weird stuff that may happen during the detection attempt will simply break and raise.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodetherapy%2Fterminal_size","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodetherapy%2Fterminal_size","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodetherapy%2Fterminal_size/lists"}