Merge branch 'master' into re-architect-widgets

This commit is contained in:
Kevin Cotugno 2020-09-28 22:05:18 -07:00
commit 2616308baa
7 changed files with 45 additions and 7 deletions

View File

@ -1,8 +1,6 @@
package exhibit package exhibit
import ( import (
"golang.org/x/sys/unix"
"bytes" "bytes"
"fmt" "fmt"
"image" "image"
@ -11,6 +9,8 @@ import (
"os" "os"
"sync" "sync"
"time" "time"
"golang.org/x/sys/unix"
) )
const ( const (
@ -67,7 +67,7 @@ func Init() *Terminal {
log.Panic(err) log.Panic(err)
} }
termios, err := unix.IoctlGetTermios(int(out.Fd()), unix.TCGETS) termios, err := unix.IoctlGetTermios(int(out.Fd()), ioctlReadTermios)
if err != nil { if err != nil {
out.Close() out.Close()
in.Close() in.Close()
@ -367,7 +367,7 @@ func (t *Terminal) enterRaw() {
termios.Cc[unix.VMIN] = 1 termios.Cc[unix.VMIN] = 1
termios.Cc[unix.VTIME] = 0 termios.Cc[unix.VTIME] = 0
err := unix.IoctlSetTermios(t.outFd(), unix.TCSETS, &termios) err := unix.IoctlSetTermios(t.outFd(), ioctlWriteTermios, &termios)
if err != nil { if err != nil {
t.exitAlt() t.exitAlt()
t.out.Close() t.out.Close()
@ -377,7 +377,7 @@ func (t *Terminal) enterRaw() {
} }
func (t *Terminal) exitRaw() { func (t *Terminal) exitRaw() {
err := unix.IoctlSetTermios(t.outFd(), unix.TCSETS, &t.termios) err := unix.IoctlSetTermios(t.outFd(), ioctlWriteTermios, &t.termios)
if err != nil { if err != nil {
t.out.Close() t.out.Close()
t.in.Close() t.in.Close()

10
exhibit/termios_bsd.go Normal file
View File

@ -0,0 +1,10 @@
// +build darwin freebsd netbsd openbsd
package exhibit
import (
"syscall"
)
const ioctlReadTermios = syscall.TIOCGETA
const ioctlWriteTermios = syscall.TIOCSETA

10
exhibit/termios_linux.go Normal file
View File

@ -0,0 +1,10 @@
// +build linux
package exhibit
import (
"golang.org/x/sys/unix"
)
const ioctlReadTermios = unix.TCGETS
const ioctlWriteTermios = unix.TCSETS

10
go.mod Normal file
View File

@ -0,0 +1,10 @@
module git.cotugno.family/kevin/spectator
go 1.15
require (
github.com/emirpasic/gods v1.12.0
github.com/gorilla/websocket v1.4.2
github.com/shopspring/decimal v1.2.0
golang.org/x/sys v0.0.0-20200928205150-006507a75852
)

8
go.sum Normal file
View File

@ -0,0 +1,8 @@
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
golang.org/x/sys v0.0.0-20200928205150-006507a75852 h1:sXxgOAXy8JwHhZnPuItAlUtwIlxrlEqi28mKhUR+zZY=
golang.org/x/sys v0.0.0-20200928205150-006507a75852/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"git.kevincotugno.com/kcotugno/spectator/exhibit" "git.cotugno.family/kevin/spectator/exhibit"
) )
type ListEntry struct { type ListEntry struct {

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"git.kevincotugno.com/kcotugno/spectator/exhibit" "git.cotugno.family/kevin/spectator/exhibit"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
"image" "image"