{"id":27880863,"url":"https://github.com/atomicgo/cursor","last_synced_at":"2025-05-05T04:38:56.047Z","repository":{"id":38390431,"uuid":"356982173","full_name":"atomicgo/cursor","owner":"atomicgo","description":"🖱️ Go module to move the terminal cursor in any direction on every operating system.","archived":false,"fork":false,"pushed_at":"2024-08-08T17:04:12.000Z","size":92,"stargazers_count":92,"open_issues_count":4,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-10T13:09:22.128Z","etag":null,"topics":["atomicgo","cursor","go","golang","golang-library","terminal","tui"],"latest_commit_sha":null,"homepage":"https://atomicgo.dev","language":"Go","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/atomicgo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":["MarvinJWendt"]}},"created_at":"2021-04-11T21:20:45.000Z","updated_at":"2024-11-09T17:27:56.000Z","dependencies_parsed_at":"2023-02-08T20:31:14.107Z","dependency_job_id":"ae7a5502-c687-4e0f-9e57-fda0208445ef","html_url":"https://github.com/atomicgo/cursor","commit_stats":{"total_commits":76,"total_committers":7,"mean_commits":"10.857142857142858","dds":0.1578947368421053,"last_synced_commit":"3d3b3200ab8d0fe46d071eb466f9ed35cdc72965"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":"atomicgo/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Fcursor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Fcursor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Fcursor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicgo%2Fcursor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicgo","download_url":"https://codeload.github.com/atomicgo/cursor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442480,"owners_count":21748448,"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":["atomicgo","cursor","go","golang","golang-library","terminal","tui"],"created_at":"2025-05-05T04:38:54.695Z","updated_at":"2025-05-05T04:38:56.039Z","avatar_url":"https://github.com/atomicgo.png","language":"Go","funding_links":["https://github.com/sponsors/MarvinJWendt"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\n\n\n┌───────────────────────────────────────────────────────────────────┐\n│                                                                   │\n│                          IMPORTANT NOTE                           │\n│                                                                   │\n│               This file is automatically generated                │\n│           All manual modifications will be overwritten            │\n│                                                                   │\n└───────────────────────────────────────────────────────────────────┘\n\n\n\n--\u003e\n\n\u003ch1 align=\"center\"\u003eAtomicGo | cursor\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fatomicgo.dev%2Fapi%2Fshields%2Fcursor\u0026style=flat-square\" alt=\"Downloads\"\u003e\n\n\u003ca href=\"https://github.com/atomicgo/cursor/releases\"\u003e\n\u003cimg src=\"https://img.shields.io/github/v/release/atomicgo/cursor?style=flat-square\" alt=\"Latest Release\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/atomicgo/cursor\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/atomicgo/cursor/go.yml?style=flat-square\" alt=\"Tests\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/atomicgo/cursor\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/codecov/c/gh/atomicgo/cursor?color=magenta\u0026logo=codecov\u0026style=flat-square\" alt=\"Coverage\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/gh/atomicgo/cursor\"\u003e\n\u003c!-- unittestcount:start --\u003e\u003cimg src=\"https://img.shields.io/badge/Unit_Tests-2-magenta?style=flat-square\" alt=\"Unit test count\"\u003e\u003c!-- unittestcount:end --\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square\" alt=\"License: MIT\"\u003e\n\u003c/a\u003e\n  \n\u003ca href=\"https://goreportcard.com/report/github.com/atomicgo/cursor\" target=\"_blank\"\u003e\n\u003cimg src=\"https://goreportcard.com/badge/github.com/atomicgo/cursor?style=flat-square\" alt=\"Go report\"\u003e\n\u003c/a\u003e   \n\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003cstrong\u003e\u003ca href=\"https://pkg.go.dev/atomicgo.dev/cursor#section-documentation\" target=\"_blank\"\u003eDocumentation\u003c/a\u003e\u003c/strong\u003e\n|\n\u003cstrong\u003e\u003ca href=\"https://github.com/atomicgo/atomicgo/blob/main/CONTRIBUTING.md\" target=\"_blank\"\u003eContributing\u003c/a\u003e\u003c/strong\u003e\n|\n\u003cstrong\u003e\u003ca href=\"https://github.com/atomicgo/atomicgo/blob/main/CODE_OF_CONDUCT.md\" target=\"_blank\"\u003eCode of Conduct\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/atomicgo/atomicgo/main/assets/header.png\" alt=\"AtomicGo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e\n\u003ch3  align=\"center\"\u003e\u003cpre\u003ego get atomicgo.dev/cursor\u003c/pre\u003e\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/p\u003e\n\n\u003c!-- gomarkdoc:embed:start --\u003e\n\n\u003c!-- Code generated by gomarkdoc. DO NOT EDIT --\u003e\n\n# cursor\n\n```go\nimport \"atomicgo.dev/cursor\"\n```\n\nPackage cursor contains cross\\-platform methods to move the terminal cursor in different directions. This package can be used to create interactive CLI tools and games, live charts, algorithm visualizations and other updatable output of any kind.\n\nWorks niceley with https://github.com/atomicgo/keyboard\n\nSpecial thanks to github.com/k0kubun/go\\-ansi which this project is based on.\n\n## Index\n\n- [func Bottom\\(\\)](\u003c#Bottom\u003e)\n- [func Clear\\(\\)](\u003c#Clear\u003e)\n- [func ClearLine\\(\\)](\u003c#ClearLine\u003e)\n- [func ClearLinesDown\\(n int\\)](\u003c#ClearLinesDown\u003e)\n- [func ClearLinesUp\\(n int\\)](\u003c#ClearLinesUp\u003e)\n- [func Down\\(n int\\)](\u003c#Down\u003e)\n- [func DownAndClear\\(n int\\)](\u003c#DownAndClear\u003e)\n- [func Hide\\(\\)](\u003c#Hide\u003e)\n- [func HorizontalAbsolute\\(n int\\)](\u003c#HorizontalAbsolute\u003e)\n- [func Left\\(n int\\)](\u003c#Left\u003e)\n- [func Move\\(x, y int\\)](\u003c#Move\u003e)\n- [func Right\\(n int\\)](\u003c#Right\u003e)\n- [func SetTarget\\(w Writer\\)](\u003c#SetTarget\u003e)\n- [func Show\\(\\)](\u003c#Show\u003e)\n- [func StartOfLine\\(\\)](\u003c#StartOfLine\u003e)\n- [func StartOfLineDown\\(n int\\)](\u003c#StartOfLineDown\u003e)\n- [func StartOfLineUp\\(n int\\)](\u003c#StartOfLineUp\u003e)\n- [func TestCustomIOWriter\\(t \\*testing.T\\)](\u003c#TestCustomIOWriter\u003e)\n- [func Up\\(n int\\)](\u003c#Up\u003e)\n- [func UpAndClear\\(n int\\)](\u003c#UpAndClear\u003e)\n- [type Area](\u003c#Area\u003e)\n  - [func NewArea\\(\\) Area](\u003c#NewArea\u003e)\n  - [func \\(area \\*Area\\) Bottom\\(\\)](\u003c#Area.Bottom\u003e)\n  - [func \\(area \\*Area\\) Clear\\(\\)](\u003c#Area.Clear\u003e)\n  - [func \\(area \\*Area\\) ClearLinesDown\\(n int\\)](\u003c#Area.ClearLinesDown\u003e)\n  - [func \\(area \\*Area\\) ClearLinesUp\\(n int\\)](\u003c#Area.ClearLinesUp\u003e)\n  - [func \\(area \\*Area\\) Down\\(n int\\)](\u003c#Area.Down\u003e)\n  - [func \\(area \\*Area\\) DownAndClear\\(n int\\)](\u003c#Area.DownAndClear\u003e)\n  - [func \\(area \\*Area\\) Move\\(x, y int\\)](\u003c#Area.Move\u003e)\n  - [func \\(area \\*Area\\) StartOfLine\\(\\)](\u003c#Area.StartOfLine\u003e)\n  - [func \\(area \\*Area\\) StartOfLineDown\\(n int\\)](\u003c#Area.StartOfLineDown\u003e)\n  - [func \\(area \\*Area\\) StartOfLineUp\\(n int\\)](\u003c#Area.StartOfLineUp\u003e)\n  - [func \\(area \\*Area\\) Top\\(\\)](\u003c#Area.Top\u003e)\n  - [func \\(area \\*Area\\) Up\\(n int\\)](\u003c#Area.Up\u003e)\n  - [func \\(area \\*Area\\) UpAndClear\\(n int\\)](\u003c#Area.UpAndClear\u003e)\n  - [func \\(area \\*Area\\) Update\\(content string\\)](\u003c#Area.Update\u003e)\n  - [func \\(area Area\\) WithWriter\\(writer Writer\\) Area](\u003c#Area.WithWriter\u003e)\n- [type Cursor](\u003c#Cursor\u003e)\n  - [func NewCursor\\(\\) \\*Cursor](\u003c#NewCursor\u003e)\n  - [func \\(c \\*Cursor\\) Clear\\(\\)](\u003c#Cursor.Clear\u003e)\n  - [func \\(c \\*Cursor\\) ClearLine\\(\\)](\u003c#Cursor.ClearLine\u003e)\n  - [func \\(c \\*Cursor\\) Down\\(n int\\)](\u003c#Cursor.Down\u003e)\n  - [func \\(c \\*Cursor\\) Hide\\(\\)](\u003c#Cursor.Hide\u003e)\n  - [func \\(c \\*Cursor\\) HorizontalAbsolute\\(n int\\)](\u003c#Cursor.HorizontalAbsolute\u003e)\n  - [func \\(c \\*Cursor\\) Left\\(n int\\)](\u003c#Cursor.Left\u003e)\n  - [func \\(c \\*Cursor\\) Right\\(n int\\)](\u003c#Cursor.Right\u003e)\n  - [func \\(c \\*Cursor\\) Show\\(\\)](\u003c#Cursor.Show\u003e)\n  - [func \\(c \\*Cursor\\) Up\\(n int\\)](\u003c#Cursor.Up\u003e)\n  - [func \\(c \\*Cursor\\) WithWriter\\(w Writer\\) \\*Cursor](\u003c#Cursor.WithWriter\u003e)\n- [type Writer](\u003c#Writer\u003e)\n\n\n\u003ca name=\"Bottom\"\u003e\u003c/a\u003e\n## func [Bottom](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L86\u003e)\n\n```go\nfunc Bottom()\n```\n\nBottom moves the cursor to the bottom of the terminal. This is done by calculating how many lines were moved by Up and Down.\n\n\u003ca name=\"Clear\"\u003e\u003c/a\u003e\n## func [Clear](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L80\u003e)\n\n```go\nfunc Clear()\n```\n\nClear clears the current position and moves the cursor to the left.\n\n\u003ca name=\"ClearLine\"\u003e\u003c/a\u003e\n## func [ClearLine](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L75\u003e)\n\n```go\nfunc ClearLine()\n```\n\nClearLine clears the current line and moves the cursor to it's start position.\n\n\u003ca name=\"ClearLinesDown\"\u003e\u003c/a\u003e\n## func [ClearLinesDown](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L149\u003e)\n\n```go\nfunc ClearLinesDown(n int)\n```\n\nClearLinesDown clears n lines downwards from the current position and moves the cursor.\n\n\u003ca name=\"ClearLinesUp\"\u003e\u003c/a\u003e\n## func [ClearLinesUp](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L142\u003e)\n\n```go\nfunc ClearLinesUp(n int)\n```\n\nClearLinesUp clears n lines upwards from the current position and moves the cursor.\n\n\u003ca name=\"Down\"\u003e\u003c/a\u003e\n## func [Down](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L36\u003e)\n\n```go\nfunc Down(n int)\n```\n\nDown moves the cursor n lines down relative to the current position.\n\n\u003ca name=\"DownAndClear\"\u003e\u003c/a\u003e\n## func [DownAndClear](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L119\u003e)\n\n```go\nfunc DownAndClear(n int)\n```\n\nDownAndClear moves the cursor down by n lines, then clears the line.\n\n\u003ca name=\"Hide\"\u003e\u003c/a\u003e\n## func [Hide](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L70\u003e)\n\n```go\nfunc Hide()\n```\n\nHide the cursor. Don't forget to show the cursor at least at the end of your application with Show. Otherwise the user might have a terminal with a permanently hidden cursor, until they reopen the terminal.\n\n\u003ca name=\"HorizontalAbsolute\"\u003e\u003c/a\u003e\n## func [HorizontalAbsolute](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L56\u003e)\n\n```go\nfunc HorizontalAbsolute(n int)\n```\n\nHorizontalAbsolute moves the cursor to n horizontally. The position n is absolute to the start of the line.\n\n\u003ca name=\"Left\"\u003e\u003c/a\u003e\n## func [Left](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L50\u003e)\n\n```go\nfunc Left(n int)\n```\n\nLeft moves the cursor n characters to the left relative to the current position.\n\n\u003ca name=\"Move\"\u003e\u003c/a\u003e\n## func [Move](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L125\u003e)\n\n```go\nfunc Move(x, y int)\n```\n\nMove moves the cursor relative by x and y.\n\n\u003ca name=\"Right\"\u003e\u003c/a\u003e\n## func [Right](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L45\u003e)\n\n```go\nfunc Right(n int)\n```\n\nRight moves the cursor n characters to the right relative to the current position.\n\n\u003ca name=\"SetTarget\"\u003e\u003c/a\u003e\n## func [SetTarget](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L25\u003e)\n\n```go\nfunc SetTarget(w Writer)\n```\n\nSetTarget sets to output target of the default curser to the provided cursor.Writer \\(wrapping io.Writer\\).\n\n\u003ca name=\"Show\"\u003e\u003c/a\u003e\n## func [Show](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L63\u003e)\n\n```go\nfunc Show()\n```\n\nShow the cursor if it was hidden previously. Don't forget to show the cursor at least at the end of your application. Otherwise the user might have a terminal with a permanently hidden cursor, until they reopen the terminal.\n\n\u003ca name=\"StartOfLine\"\u003e\u003c/a\u003e\n## func [StartOfLine](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L96\u003e)\n\n```go\nfunc StartOfLine()\n```\n\nStartOfLine moves the cursor to the start of the current line.\n\n\u003ca name=\"StartOfLineDown\"\u003e\u003c/a\u003e\n## func [StartOfLineDown](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L101\u003e)\n\n```go\nfunc StartOfLineDown(n int)\n```\n\nStartOfLineDown moves the cursor down by n lines, then moves to cursor to the start of the line.\n\n\u003ca name=\"StartOfLineUp\"\u003e\u003c/a\u003e\n## func [StartOfLineUp](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L107\u003e)\n\n```go\nfunc StartOfLineUp(n int)\n```\n\nStartOfLineUp moves the cursor up by n lines, then moves to cursor to the start of the line.\n\n\u003ca name=\"TestCustomIOWriter\"\u003e\u003c/a\u003e\n## func [TestCustomIOWriter](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_test_linux.go#L9\u003e)\n\n```go\nfunc TestCustomIOWriter(t *testing.T)\n```\n\nTestCustomIOWriter tests the cursor functions with a custom Writer.\n\n\u003ca name=\"Up\"\u003e\u003c/a\u003e\n## func [Up](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L30\u003e)\n\n```go\nfunc Up(n int)\n```\n\nUp moves the cursor n lines up relative to the current position.\n\n\u003ca name=\"UpAndClear\"\u003e\u003c/a\u003e\n## func [UpAndClear](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L113\u003e)\n\n```go\nfunc UpAndClear(n int)\n```\n\nUpAndClear moves the cursor up by n lines, then clears the line.\n\n\u003ca name=\"Area\"\u003e\u003c/a\u003e\n## type [Area](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L10-L15\u003e)\n\nArea displays content which can be updated on the fly. You can use this to create live output, charts, dropdowns, etc.\n\n```go\ntype Area struct {\n    // contains filtered or unexported fields\n}\n```\n\n\u003ca name=\"NewArea\"\u003e\u003c/a\u003e\n### func [NewArea](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L18\u003e)\n\n```go\nfunc NewArea() Area\n```\n\nNewArea returns a new Area.\n\n\u003ca name=\"Area.Bottom\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Bottom](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L86\u003e)\n\n```go\nfunc (area *Area) Bottom()\n```\n\nBottom moves the cursor to the bottom of the terminal. This is done by calculating how many lines were moved by Up and Down.\n\n\u003ca name=\"Area.Clear\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Clear](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L36\u003e)\n\n```go\nfunc (area *Area) Clear()\n```\n\nClear clears the content of the Area.\n\n\u003ca name=\"Area.ClearLinesDown\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [ClearLinesDown](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L157\u003e)\n\n```go\nfunc (area *Area) ClearLinesDown(n int)\n```\n\nClearLinesDown clears n lines downwards from the current position and moves the cursor.\n\n\u003ca name=\"Area.ClearLinesUp\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [ClearLinesUp](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L147\u003e)\n\n```go\nfunc (area *Area) ClearLinesUp(n int)\n```\n\nClearLinesUp clears n lines upwards from the current position and moves the cursor.\n\n\u003ca name=\"Area.Down\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Down](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L73\u003e)\n\n```go\nfunc (area *Area) Down(n int)\n```\n\nDown moves the cursor of the area down one line.\n\n\u003ca name=\"Area.DownAndClear\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [DownAndClear](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L126\u003e)\n\n```go\nfunc (area *Area) DownAndClear(n int)\n```\n\nDownAndClear moves the cursor down by n lines, then clears the line.\n\n\u003ca name=\"Area.Move\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Move](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L132\u003e)\n\n```go\nfunc (area *Area) Move(x, y int)\n```\n\nMove moves the cursor relative by x and y.\n\n\u003ca name=\"Area.StartOfLine\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [StartOfLine](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L103\u003e)\n\n```go\nfunc (area *Area) StartOfLine()\n```\n\nStartOfLine moves the cursor to the start of the current line.\n\n\u003ca name=\"Area.StartOfLineDown\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [StartOfLineDown](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L108\u003e)\n\n```go\nfunc (area *Area) StartOfLineDown(n int)\n```\n\nStartOfLineDown moves the cursor down by n lines, then moves to cursor to the start of the line.\n\n\u003ca name=\"Area.StartOfLineUp\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [StartOfLineUp](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L114\u003e)\n\n```go\nfunc (area *Area) StartOfLineUp(n int)\n```\n\nStartOfLineUp moves the cursor up by n lines, then moves to cursor to the start of the line.\n\n\u003ca name=\"Area.Top\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Top](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L95\u003e)\n\n```go\nfunc (area *Area) Top()\n```\n\nTop moves the cursor to the top of the area. This is done by calculating how many lines were moved by Up and Down.\n\n\u003ca name=\"Area.Up\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Up](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L61\u003e)\n\n```go\nfunc (area *Area) Up(n int)\n```\n\nUp moves the cursor of the area up one line.\n\n\u003ca name=\"Area.UpAndClear\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [UpAndClear](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L120\u003e)\n\n```go\nfunc (area *Area) UpAndClear(n int)\n```\n\nUpAndClear moves the cursor up by n lines, then clears the line.\n\n\u003ca name=\"Area.Update\"\u003e\u003c/a\u003e\n### func \\(\\*Area\\) [Update](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L53\u003e)\n\n```go\nfunc (area *Area) Update(content string)\n```\n\nUpdate overwrites the content of the Area and adjusts its height based on content.\n\n\u003ca name=\"Area.WithWriter\"\u003e\u003c/a\u003e\n### func \\(Area\\) [WithWriter](\u003chttps://github.com/atomicgo/cursor/blob/main/area.go#L28\u003e)\n\n```go\nfunc (area Area) WithWriter(writer Writer) Area\n```\n\nWithWriter sets the custom writer.\n\n\u003ca name=\"Cursor\"\u003e\u003c/a\u003e\n## type [Cursor](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor.go#L9-L11\u003e)\n\nCursor displays content which can be updated on the fly. You can use this to create live output, charts, dropdowns, etc.\n\n```go\ntype Cursor struct {\n    // contains filtered or unexported fields\n}\n```\n\n\u003ca name=\"NewCursor\"\u003e\u003c/a\u003e\n### func [NewCursor](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor.go#L14\u003e)\n\n```go\nfunc NewCursor() *Cursor\n```\n\nNewCursor creates a new Cursor instance writing to os.Stdout.\n\n\u003ca name=\"Cursor.Clear\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Clear](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L65\u003e)\n\n```go\nfunc (c *Cursor) Clear()\n```\n\nClear clears the current position and moves the cursor to the left.\n\n\u003ca name=\"Cursor.ClearLine\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [ClearLine](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L60\u003e)\n\n```go\nfunc (c *Cursor) ClearLine()\n```\n\nClearLine clears the current line and moves the cursor to it's start position.\n\n\u003ca name=\"Cursor.Down\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Down](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L18\u003e)\n\n```go\nfunc (c *Cursor) Down(n int)\n```\n\nDown moves the cursor n lines down relative to the current position.\n\n\u003ca name=\"Cursor.Hide\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Hide](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L55\u003e)\n\n```go\nfunc (c *Cursor) Hide()\n```\n\nHide the cursor. Don't forget to show the cursor at least at the end of your application with Show. Otherwise the user might have a terminal with a permanently hidden cursor, until they reopen the terminal.\n\n\u003ca name=\"Cursor.HorizontalAbsolute\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [HorizontalAbsolute](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L40\u003e)\n\n```go\nfunc (c *Cursor) HorizontalAbsolute(n int)\n```\n\nHorizontalAbsolute moves the cursor to n horizontally. The position n is absolute to the start of the line.\n\n\u003ca name=\"Cursor.Left\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Left](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L32\u003e)\n\n```go\nfunc (c *Cursor) Left(n int)\n```\n\nLeft moves the cursor n characters to the left relative to the current position.\n\n\u003ca name=\"Cursor.Right\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Right](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L25\u003e)\n\n```go\nfunc (c *Cursor) Right(n int)\n```\n\nRight moves the cursor n characters to the right relative to the current position.\n\n\u003ca name=\"Cursor.Show\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Show](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L48\u003e)\n\n```go\nfunc (c *Cursor) Show()\n```\n\nShow the cursor if it was hidden previously. Don't forget to show the cursor at least at the end of your application. Otherwise the user might have a terminal with a permanently hidden cursor, until they reopen the terminal.\n\n\u003ca name=\"Cursor.Up\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [Up](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor_other.go#L11\u003e)\n\n```go\nfunc (c *Cursor) Up(n int)\n```\n\nUp moves the cursor n lines up relative to the current position.\n\n\u003ca name=\"Cursor.WithWriter\"\u003e\u003c/a\u003e\n### func \\(\\*Cursor\\) [WithWriter](\u003chttps://github.com/atomicgo/cursor/blob/main/cursor.go#L20\u003e)\n\n```go\nfunc (c *Cursor) WithWriter(w Writer) *Cursor\n```\n\nWithWriter allows for any arbitrary Writer to be used for cursor movement abstracted.\n\n\u003ca name=\"Writer\"\u003e\u003c/a\u003e\n## type [Writer](\u003chttps://github.com/atomicgo/cursor/blob/main/utils.go#L18-L21\u003e)\n\nWriter is an expanded io.Writer interface with a file descriptor.\n\n```go\ntype Writer interface {\n    io.Writer\n    Fd() uintptr\n}\n```\n\nGenerated by [gomarkdoc](\u003chttps://github.com/princjef/gomarkdoc\u003e)\n\n\n\u003c!-- gomarkdoc:embed:end --\u003e\n\n---\n\n\u003e [AtomicGo.dev](https://atomicgo.dev) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e with ❤️ by [@MarvinJWendt](https://github.com/MarvinJWendt) |\n\u003e [MarvinJWendt.com](https://marvinjwendt.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicgo%2Fcursor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicgo%2Fcursor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicgo%2Fcursor/lists"}