{"id":17806152,"url":"https://github.com/chengxilo/virtualterm","last_synced_at":"2026-04-13T03:35:05.171Z","repository":{"id":257784062,"uuid":"859630485","full_name":"chengxilo/virtualterm","owner":"chengxilo","description":"virtualTerm help you predict what the string looks like if you output it into a terminal.","archived":false,"fork":false,"pushed_at":"2025-07-14T01:06:51.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-30T21:34:11.829Z","etag":null,"topics":["ascii","bash","cmd","control-sequ","gitbash","golang","powershell","rune","runes","string","terminal","utf-8","virtual"],"latest_commit_sha":null,"homepage":"","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/chengxilo.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-19T02:19:12.000Z","updated_at":"2025-01-26T04:24:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"5564c9ff-12f9-4bf2-a117-e5b9d649adf3","html_url":"https://github.com/chengxilo/virtualterm","commit_stats":null,"previous_names":["chengxilo/virtualterm"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/chengxilo/virtualterm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengxilo%2Fvirtualterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengxilo%2Fvirtualterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengxilo%2Fvirtualterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengxilo%2Fvirtualterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chengxilo","download_url":"https://codeload.github.com/chengxilo/virtualterm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chengxilo%2Fvirtualterm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31739050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T03:27:07.512Z","status":"ssl_error","status_checked_at":"2026-04-13T03:26:53.610Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ascii","bash","cmd","control-sequ","gitbash","golang","powershell","rune","runes","string","terminal","utf-8","virtual"],"created_at":"2024-10-27T13:04:24.593Z","updated_at":"2026-04-13T03:35:05.131Z","avatar_url":"https://github.com/chengxilo.png","language":"Go","readme":"# virtual-term\n\n virtualTerm is created to simulate a terminal,handle the special character such as '\\r','\\b'.\nWrite a string into VirtualTerm, you will know what would your string be like if you output it to stdout.\n\n\n## Now Support 😎\n\n### Character Encoding\n* ASCII\n* UTF-8\n\n### Control Characters\n* `\\b` backspace\n* `\\r` carriage return\n* `\\n` feed line\n* `ESC[#A`\tmoves cursor up # lines\n* `ESC[#B`\tmoves cursor down # lines\n* `ESC[#C`\tmoves cursor right # columns\n* `ESC[#D`\tmoves cursor left # columns\n* `ESC[H`  moves cursor to home position\n\n***WARNING:*** if you try to write not supported ESC to it, the output may can not be predicted\n\n## install🛸\nyou need go mod to use it. Just always use the latest version.\n```shell\ngo get -u github.com/chengxilo/virtualterm\n```\n\n## Getting Started 🤔\n\nexample\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/chengxilo/virtualterm\"\n    \"log\"\n)\n\nfunc main() {\n    str := \"hello\\rvirtuaa\\bl-terminal\"\n    vt := virtualterm.NewDefault()\n    vt.Write([]byte(str))\n    fmt.Println(str == \"virtual-terminal\")\n    str,err := vt.String()\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Println(str == \"virtual-terminal\")\n    // Output:\n    // false\n    // true\n}\n\n```\n\nUse `virtualterm.Process` function. You will not need to create a virtual terminal and input on your own.\n```golang\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/chengxilo/virtualterm\"\n)\n\nfunc main() {\n    str := \"hello\\rvirtuaa\\bl-terminal\"\n    newS,_ := virtualterm.Process(str)\n    fmt.Println(str == \"virtual-terminal\")\n    fmt.Println(newS == \"virtual-terminal\")\n    // Output:\n    // false\n    // true\n}\n```\n\ngo test. This is why I want to create this repository.\nIf you don't use this,just use the str, all of them will fail.\n```go\npackage test\n\nimport (\n    \"fmt\"\n    \"github.com/chengxilo/virtualterm\"\n    \"github.com/stretchr/testify/assert\"\n    \"testing\"\n)\n\nfunc TestVirtualTerm(t *testing.T) {\n    str := \"hello\\rvirtuaa\\bl-terminal\"\n    ns,_ := virtualterm.Process(str)\n    assert.Equal(t, ns, \"virtual-terminal\")\n}\n\nfunc ExampleVirtualTerm() {\n    str := \"hello\\rvirtuaa\\bl-terminal\"\n    ns,_ := virtualterm.Process(str)\n    fmt.Print(ns)\n    // Output:\n    // virtual-terminal\n}\n```\n\n# Contribution 🎉\n\nPull requests are welcome. Feel free to...\n\n- Revise documentation\n- Add new features\n- Fix bugs\n- Suggest improvements\n- or whatever you want...\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchengxilo%2Fvirtualterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchengxilo%2Fvirtualterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchengxilo%2Fvirtualterm/lists"}