{"id":13817205,"url":"https://github.com/pkg/term","last_synced_at":"2025-05-14T17:09:13.985Z","repository":{"id":16729658,"uuid":"19486830","full_name":"pkg/term","owner":"pkg","description":"Package term manages POSIX terminals.","archived":false,"fork":false,"pushed_at":"2024-06-27T17:08:00.000Z","size":128,"stargazers_count":395,"open_issues_count":13,"forks_count":66,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-20T02:03:06.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dennis714/RE-for-beginners","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkg.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":"2014-05-06T08:29:34.000Z","updated_at":"2025-03-27T15:53:01.000Z","dependencies_parsed_at":"2024-08-04T06:11:40.900Z","dependency_job_id":null,"html_url":"https://github.com/pkg/term","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkg","download_url":"https://codeload.github.com/pkg/term/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190396,"owners_count":22029632,"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-08-04T06:00:36.841Z","updated_at":"2025-05-14T17:09:13.955Z","avatar_url":"https://github.com/pkg.png","language":"Go","funding_links":[],"categories":["Misc","Go"],"sub_categories":[],"readme":"\n# term\n    import \"github.com/pkg/term\"\n\nPackage term manages POSIX terminals. As POSIX terminals are connected to,\nor emulate, a UART, this package also provides control over the various\nUART and serial line parameters.\n\n\n\n\n\n\n## func CBreakMode\n``` go\nfunc CBreakMode(t *Term) error\n```\nCBreakMode places the terminal into cbreak mode.\n\n\n## func RawMode\n``` go\nfunc RawMode(t *Term) error\n```\nRawMode places the terminal into raw mode.\n\n\n## func Speed\n``` go\nfunc Speed(baud int) func(*Term) error\n```\nSpeed sets the baud rate option for the terminal.\n\n\n\n## type Term\n``` go\ntype Term struct {\n    // contains filtered or unexported fields\n}\n```\nTerm represents an asynchronous communications port.\n\n\n\n\n\n\n\n\n\n### func Open\n``` go\nfunc Open(name string, options ...func(*Term) error) (*Term, error)\n```\nOpen opens an asynchronous communications port.\n\n\n\n\n### func (\\*Term) Available\n``` go\nfunc (t *Term) Available() (int, error)\n```\nAvailable returns how many bytes are unused in the buffer.\n\n\n\n### func (\\*Term) Buffered\n``` go\nfunc (t *Term) Buffered() (int, error)\n```\nBuffered returns the number of bytes that have been written into the current buffer.\n\n\n\n### func (\\*Term) Close\n``` go\nfunc (t *Term) Close() error\n```\nClose closes the device and releases any associated resources.\n\n\n\n### func (\\*Term) DTR\n``` go\nfunc (t *Term) DTR() (bool, error)\n```\nDTR returns the state of the DTR (data terminal ready) signal.\n\n\n\n### func (\\*Term) Flush\n``` go\nfunc (t *Term) Flush() error\n```\nFlush flushes both data received but not read, and data written but not transmitted.\n\n\n\n### func (\\*Term) RTS\n``` go\nfunc (t *Term) RTS() (bool, error)\n```\nRTS returns the state of the RTS (data terminal ready) signal.\n\n\n\n### func (\\*Term) Read\n``` go\nfunc (t *Term) Read(b []byte) (int, error)\n```\nRead reads up to len(b) bytes from the terminal. It returns the number of\nbytes read and an error, if any. EOF is signaled by a zero count with\nerr set to io.EOF.\n\n\n\n### func (\\*Term) Restore\n``` go\nfunc (t *Term) Restore() error\n```\nRestore restores the state of the terminal captured at the point that\nthe terminal was originally opened.\n\n\n\n### func (\\*Term) SendBreak\n``` go\nfunc (t *Term) SendBreak() error\n```\nSendBreak sends a break signal.\n\n\n\n### func (\\*Term) SetCbreak\n``` go\nfunc (t *Term) SetCbreak() error\n```\nSetCbreak sets cbreak mode.\n\n\n\n### func (\\*Term) SetDTR\n``` go\nfunc (t *Term) SetDTR(v bool) error\n```\nSetDTR sets the DTR (data terminal ready) signal.\n\n\n\n### func (\\*Term) SetOption\n``` go\nfunc (t *Term) SetOption(options ...func(*Term) error) error\n```\nSetOption takes one or more option function and applies them in order to Term.\n\n\n\n### func (\\*Term) SetRTS\n``` go\nfunc (t *Term) SetRTS(v bool) error\n```\nSetRTS sets the RTS (data terminal ready) signal.\n\n\n\n### func (\\*Term) SetRaw\n``` go\nfunc (t *Term) SetRaw() error\n```\nSetRaw sets raw mode.\n\n\n\n### func (\\*Term) SetSpeed\n``` go\nfunc (t *Term) SetSpeed(baud int) error\n```\nSetSpeed sets the receive and transmit baud rates.\n\n\n\n### func (\\*Term) Write\n``` go\nfunc (t *Term) Write(b []byte) (int, error)\n```\nWrite writes len(b) bytes to the terminal. It returns the number of bytes\nwritten and an error, if any. Write returns a non-nil error when n !=\nlen(b).\n\n\n\n\n\n\n\n\n\n- - -\nGenerated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg%2Fterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkg%2Fterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg%2Fterm/lists"}