First commit
This commit is contained in:
commit
5f143cc5f0
19
gilo.go
Normal file
19
gilo.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"golang.org/x/term"
|
||||
"os"
|
||||
)
|
||||
|
||||
func goRaw() (*term.State, error) {
|
||||
return term.MakeRaw(int(os.Stdin.Fd()))
|
||||
}
|
||||
|
||||
func main() {
|
||||
oldState, err := goRaw()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
defer term.Restore(int(os.Stdin.Fd()), oldState)
|
||||
}
|
5
go.mod
Normal file
5
go.mod
Normal file
@ -0,0 +1,5 @@
|
||||
module timshomepage.net/gilo
|
||||
|
||||
go 1.16
|
||||
|
||||
require golang.org/x/term v0.0.0-20210317153231-de623e64d2a6
|
4
go.sum
Normal file
4
go.sum
Normal file
@ -0,0 +1,4 @@
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 h1:EC6+IGYTjPpRfv9a2b/6Puw0W+hLtAhkV1tPsXhutqs=
|
||||
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
Loading…
Reference in New Issue
Block a user