https://github.com/danielgatis/go-vte
A library to parse terminal escape sequences (almost) exactly how the real hardware does.
https://github.com/danielgatis/go-vte
go golang parser terminal-emulator vt100 vte
Last synced: 7 months ago
JSON representation
A library to parse terminal escape sequences (almost) exactly how the real hardware does.
- Host: GitHub
- URL: https://github.com/danielgatis/go-vte
- Owner: danielgatis
- License: mit
- Created: 2020-05-22T01:33:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-03T20:13:13.000Z (9 months ago)
- Last Synced: 2025-03-19T00:06:37.654Z (7 months ago)
- Topics: go, golang, parser, terminal-emulator, vt100, vte
- Language: Go
- Size: 102 KB
- Stars: 25
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-vte
[](https://goreportcard.com/report/github.com/danielgatis/go-vte)
[](https://raw.githubusercontent.com/danielgatis/go-vte/master/LICENSE)
[](https://godoc.org/github.com/danielgatis/go-vte)A GO version of https://github.com/alacritty/vte.
The pkg `vtparse` implements a state machine that mirrors the behaviour of DEC (Digital Equipment Corporation) VT hardware terminals. The state machine was originally described by Paul Williams; more information can be found here: http://www.vt100.net/emu/dec_ansi_parser.
## Install
```bash
go get -u github.com/danielgatis/go-vte
```And then import the package in your code:
```go
import "github.com/danielgatis/go-vte"
```### Example
Please look at: [examples/parserlog/main.go](examples/parserlog/main.go)
```
❯ echo -ne "Hello\nWorld" | go run ./examples/parserlog/main.go
[Print] H
[Print] e
[Print] l
[Print] l
[Print] o
[Execute] 0a
[Print] W
[Print] o
[Print] r
[Print] l
[Print] d
```## License
Copyright (c) 2020-present [Daniel Gatis](https://github.com/danielgatis)
Licensed under [MIT License](./LICENSE)