{"id":18405930,"url":"https://github.com/sebi2020/go-ncurses","last_synced_at":"2025-04-07T08:32:13.101Z","repository":{"id":57555220,"uuid":"204278567","full_name":"Sebi2020/go-ncurses","owner":"Sebi2020","description":"Golang ncurses wrapper","archived":false,"fork":false,"pushed_at":"2019-09-07T18:01:40.000Z","size":81,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T15:22:36.514Z","etag":null,"topics":["go","golang","ncurses","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sebi2020.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-25T10:23:02.000Z","updated_at":"2022-12-27T23:43:53.000Z","dependencies_parsed_at":"2022-09-26T18:51:37.646Z","dependency_job_id":null,"html_url":"https://github.com/Sebi2020/go-ncurses","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/Sebi2020%2Fgo-ncurses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sebi2020%2Fgo-ncurses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sebi2020%2Fgo-ncurses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sebi2020%2Fgo-ncurses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sebi2020","download_url":"https://codeload.github.com/Sebi2020/go-ncurses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247620295,"owners_count":20968180,"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":["go","golang","ncurses","wrapper"],"created_at":"2024-11-06T03:05:38.703Z","updated_at":"2025-04-07T08:32:12.759Z","avatar_url":"https://github.com/Sebi2020.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-ncurses\n[![GoDoc](https://godoc.org/github.com/Sebi2020/go-ncurses?status.svg)](https://godoc.org/github.com/Sebi2020/go-ncurses)\n\n**go-ncurses** is a wrapper for [go](https://www.golang.org) of the famous ncurses library.\n\n```go\npackage ncurses\n\nimport ( \n\t\"fmt\"\n)\n\nmain() {\n  w,_ := ncurses.Initscr()\n  \n    // Ensure, that ncurses will be properly exited\n  defer ncurses.Endwin()\n  defer func() {\n    if r := recover(); r != nil {\n      ncurses.Endwin()\n      fmt.Printf(\"panic:\\n%s\\n\", r)\n      os.Exit(-1)\n    }\n  }()\n\n  // Enable color mode\n  ncurses.StartColor()\n\n  // Define color pairs\n  ncurses.AddColorPair(\"bw\", ncurses.ColorGreen,ncurses.ColorBlack)\n  ncurses.AddColorPair(\"wb\",ncurses.ColorWhite, ncurses.ColorBlue)\n\n  // Set cursor visiblity to hidden\n  ncurses.SetCursor(ncurses.CURSOR_HIDDEN)\n\n  // Automatically refresh after each command\n  w.AutoRefresh = true\n\n  // Set color for stdscr-window to system defaults.\n  w.Wbkgd(\"std\")\n\n  // Draw a border around main window (stdscr)\n  w.Box()\n\n  // Create a new window for greeting-text at cell (x=20,y=5) with a size of 25 x 5 cells.\n  w2,err := ncurses.NewWindow(\"dialog\",ncurses.Position{20,5},ncurses.Size{25,5})\n\n  // This can fail if the terminal is too small.\n  if err != nil {\n    panic(err)\n  }\n  w2.AutoRefresh = true\n\n  // Use color pair wb (2)\n  w2.Wbkgd(\"wb\")\n\n  // Draw a border around our \"Greeting Window\".\n  w2.Box()\n\n  // Move cursor relative to the window borders of w2\n  w2.Move(2,3)\n\n  // Output our greeting text\n  fmt.Fprintf(w2, \"Hello from Go\\u2122-Lang!\") \n\n  // Move cursor relative to the beginning of our main window\n  w.Move(17,19)\n\n  // Output exit instruction for the user\n  fmt.Fprintf(w,\" =\u003e Press a key to exit \u003c=\")\n\n  // Wait for user input (e.g. keypress)\n  w.Getch()\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebi2020%2Fgo-ncurses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebi2020%2Fgo-ncurses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebi2020%2Fgo-ncurses/lists"}