Code Monkey home page Code Monkey logo

go-libvterm's Introduction

go-libvterm

Go binding to libvterm

Usage

vt := vterm.New(25, 80)
defer vt.Close()

vt.SetUTF8(true)

screen := vt.ObtainScreen()
screen.Reset(true)

_, err := vt.Write([]byte("\033[31mHello \033[32mGolang\033[0m"))
if err != nil {
	log.Fatal(err)
}
screen.Flush()

cell, err := screen.GetCellAt(0, 0)

Requirements

libvterm: must be installed with pkg-config

Installation

$ go get github.com/mattn/go-libvterm

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

go-libvterm's People

Contributors

mattn avatar micromaomao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-libvterm's Issues

Error while fetching the package

Hello,

I'm trying to use this package that would be super helpful for a project I'm working on.

When trying to go get the package, I'm getting the following error:

dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:16:22: sc.cell.fg.red undefined (type _Ctype_VTermColor has no field or method red)
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:17:22: sc.cell.fg.green undefined (type _Ctype_VTermColor has no field or method green)
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:18:22: sc.cell.fg.blue undefined (type _Ctype_VTermColor has no field or method blue)
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:25:22: sc.cell.bg.red undefined (type _Ctype_VTermColor has no field or method red)
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:26:22: sc.cell.bg.green undefined (type _Ctype_VTermColor has no field or method green)
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:27:22: sc.cell.bg.blue undefined (type _Ctype_VTermColor has no field or method blue)
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:37:32: cannot use _Ctype_uchar(col.R) (type _Ctype_uchar) as type byte in array literal
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:37:50: cannot use _Ctype_uchar(col.G) (type _Ctype_uchar) as type byte in array literal
dev/go/src/github.com/mattn/go-libvterm/vterm-pkgconfig.go:37:68: cannot use _Ctype_uchar(col.B) (type _Ctype_uchar) as type byte in array literal

I tried on both OS X and Ubuntu, with Golang version 1.17.2

I'm happy to spend time on fixing this and provide a PR, but before I was wondering if you had any pointers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.