v0.1.7 backend fixes, go and dependency updates
This commit is contained in:
@@ -33,10 +33,6 @@ func newBackend() Backend {
|
||||
}
|
||||
|
||||
func (b *windowsBackend) Init() error {
|
||||
if os.Getenv("WT_SESSION") == "" && os.Getenv("WT_PROFILE_ID") == "" {
|
||||
return fmt.Errorf("Windows Terminal required: WT_SESSION unset; conhost lacks alt screen")
|
||||
}
|
||||
|
||||
if err := windows.GetConsoleMode(b.stdin, &b.oldStdinMode); err != nil {
|
||||
return fmt.Errorf("GetConsoleMode stdin: %w", err)
|
||||
}
|
||||
|
||||
+2
-2
@@ -43,10 +43,10 @@ func resetTerminalMode() {
|
||||
defer tty.Close()
|
||||
fd := int(tty.Fd())
|
||||
// Get current termios, enable ECHO and ICANON
|
||||
if termios, err := unix.IoctlGetTermios(fd, unix.TCGETS); err == nil {
|
||||
if termios, err := unix.IoctlGetTermios(fd, tcgets); err == nil {
|
||||
termios.Lflag |= unix.ECHO | unix.ICANON | unix.ISIG | unix.IEXTEN
|
||||
termios.Iflag |= unix.ICRNL
|
||||
unix.IoctlSetTermios(fd, unix.TCSETS, termios)
|
||||
unix.IoctlSetTermios(fd, tcsets, termios)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
module github.com/lixenwraith/terminal
|
||||
|
||||
go 1.26.0
|
||||
go 1.27.1
|
||||
|
||||
require (
|
||||
github.com/lixenwraith/color v0.0.0-20260719094342-615e11bc7897
|
||||
golang.org/x/sys v0.47.0
|
||||
golang.org/x/term v0.45.0
|
||||
golang.org/x/sys v0.48.0
|
||||
golang.org/x/term v0.46.0
|
||||
)
|
||||
|
||||
@@ -4,5 +4,9 @@ github.com/lixenwraith/color v0.0.0-20260719094342-615e11bc7897 h1:YkTK1vIzG6sqK
|
||||
github.com/lixenwraith/color v0.0.0-20260719094342-615e11bc7897/go.mod h1:p02MsAGqlmZu3sc6BPYCKmaedF+lqBoijnuu5cOrYeo=
|
||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
|
||||
golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
|
||||
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
|
||||
golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
|
||||
golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
|
||||
|
||||
package terminal
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
const (
|
||||
tcgets = unix.TIOCGETA
|
||||
tcsets = unix.TIOCSETA
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
//go:build aix || linux || solaris || zos
|
||||
|
||||
package terminal
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
const (
|
||||
tcgets = unix.TCGETS
|
||||
tcsets = unix.TCSETS
|
||||
)
|
||||
Reference in New Issue
Block a user