{"id":15555747,"url":"https://github.com/unkindpartition/ansi-terminal","last_synced_at":"2025-05-15T16:08:40.969Z","repository":{"id":12553908,"uuid":"15224185","full_name":"UnkindPartition/ansi-terminal","owner":"UnkindPartition","description":"ANSI terminal support for Haskell, with Windows compatibility","archived":false,"fork":false,"pushed_at":"2024-12-31T14:25:39.000Z","size":388,"stargazers_count":112,"open_issues_count":3,"forks_count":28,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T21:44:45.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UnkindPartition.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":null,"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":"2013-12-16T11:32:21.000Z","updated_at":"2025-02-10T09:34:45.000Z","dependencies_parsed_at":"2024-05-19T22:32:52.467Z","dependency_job_id":"707bd578-c31c-4bd6-823d-4338ecf7875e","html_url":"https://github.com/UnkindPartition/ansi-terminal","commit_stats":{"total_commits":295,"total_committers":23,"mean_commits":"12.826086956521738","dds":"0.41694915254237286","last_synced_commit":"766498f0ef4a3d91155a022ad476a934f130574b"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Fansi-terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Fansi-terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Fansi-terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Fansi-terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnkindPartition","download_url":"https://codeload.github.com/UnkindPartition/ansi-terminal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737770,"owners_count":20987718,"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-10-02T15:10:29.899Z","updated_at":"2025-04-07T22:05:53.040Z","avatar_url":"https://github.com/UnkindPartition.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"ansi-terminal and ansi-terminal-types [![GitHub CI](https://github.com/UnkindPartition/ansi-terminal/workflows/CI/badge.svg)](https://github.com/UnkindPartition/ansi-terminal/actions)\n=====================================\n\nHaskell packages together providing support for 'ANSI' control character\nsequences for terminals on Unix-like operating systems and Windows\n\nDescription\n-----------\n\n['ANSI' terminal escape code](http://en.wikipedia.org/wiki/ANSI_escape_sequences)\nsupport for Haskell, which allows:\n-   Colored text output, with control over foreground, background and (where\n    supported) underlining colors\n-   Clearing parts of a line or the screen\n-   Hiding or showing the cursor\n-   Moving the cursor around\n-   Reporting the position of the cursor\n-   Enabling and disabling automatic line wrapping\n-   Scrolling the screen up or down\n-   Switching between the Alternate and Normal Screen Buffers\n-   Clickable hyperlinks to URIs\n-   Changing the title of the terminal\n\nIf you like this, you may be interested in\n[ansi-wl-pprint](http://github.com/batterseapower/ansi-wl-pprint), which\nprovides a pretty-printer that can construct strings containing 'ANSI'\ncolorisation.\n\nNot all 'ANSI' escape codes are suported by this library but most (if not\nall) of the popular ones that are well-supported by terminal software are,\nincluding:\n-   Select Graphic Rendition mode (colors and other attributes): `setSGR`\n-   Clearing parts of the screen: `clearFromCursorToScreenEnd`,\n    `clearFromCursorToScreenBeginning`, `clearScreen`,\n    `clearFromCursorToLineEnd`, `clearFromCursorToLineBeginning` and\n    `clearLine`\n-   Cursor visibility changes: `hideCursor` and `showCursor`\n-   Cursor movement by character: `cursorUp`, `cursorDown`, `cursorForward` and\n    `cursorBackward`\n-   Cursor movement by line: `cursorUpLine` and `cursorDownLine`\n-   Directly changing cursor position: `setCursorColumn` and `setCursorPosition`\n-   Saving, restoring and reporting cursor position: `saveCursor`,\n    `restoreCursor` and `reportCursorPosition`\n-   Automatic line wrapping: `enableLineWrap` and `disableLineWrap`\n-   Scrolling the screen: `scrollPageUp` and `scrollPageDown`\n-   Changing the title: `setTitle`\n\nEach supported escape code or family of codes has a corresponding\nfunction that comes in three variants:\n\n-   A straight `IO` variant that doesn't take a `Handle` and just applies the\n    escape code to `stdout` and any terminal attached to it\n-   An `IO` variant similar to above, but which takes a `Handle` to which the\n    escape code should be applied\n-   A `String` variant that returns a literal string that should be\n    included to get the effect of the code.\n\nExample\n-------\n\nA full example is\n[available](https://github.com/UnkindPartition/ansi-terminal/blob/master/ansi-terminal/app/Example.hs),\nbut for a taste of how the library works try the following code:\n\n``` haskell\nimport System.Console.ANSI\nimport System.IO (stdout)\n\nmain :: IO ()\nmain = do\n  stdoutSupportsANSI \u003c- hNowSupportsANSI stdout\n  if stdoutSupportsANSI\n    then do\n      setCursorPosition 5 0\n      setTitle \"ANSI Terminal Short Example\"\n\n      setSGR [ SetConsoleIntensity BoldIntensity\n             , SetColor Foreground Vivid Red\n             ]\n      putStr \"Hello\"\n\n      setSGR [ SetConsoleIntensity NormalIntensity\n             , SetColor Foreground Vivid White\n             , SetColor Background Dull Blue\n             ]\n      putStrLn \"World!\"\n    else\n      putStrLn \"Standard output does not support 'ANSI' escape codes.\"\n```\n\n![](https://raw.githubusercontent.com/feuerbach/ansi-terminal/master/example.png)\n\nDocumentation\n-------------\n\nHaddock documentation is available at Hackage\n([`ansi-terminal`](http://hackage.haskell.org/packages/archive/ansi-terminal/latest/doc/html/System-Console-ANSI.html))\nand\n([`ansi-terminal-types`](http://hackage.haskell.org/packages/archive/ansi-terminal-types/latest/doc/html/System-Console-ANSI-Types.html)).\n\nCredits\n-------\n\nThe library was originally written by [Max Bolingbroke](https://github.com/batterseapower)\n\nMaintainers\n-----------\n\n[Mike Pilgrem](https://github.com/mpilgrem) and [Roman Cheplyaka](https://github.com/UnkindPartition) are the primary maintainers.\n\n[Oliver Charles](https://github.com/ocharles) is the backup maintainer. Please\nget in touch with him if the primary maintainers cannot be reached.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funkindpartition%2Fansi-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funkindpartition%2Fansi-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funkindpartition%2Fansi-terminal/lists"}