summaryrefslogtreecommitdiff
path: root/tty_notwindows.go
diff options
context:
space:
mode:
authortheimpostor <sahirhoda@gmail.com>2024-11-11 14:01:48 -0600
committertheimpostor <sahirhoda@gmail.com>2024-11-11 14:01:48 -0600
commit6acbe36b9592bb9eded805db7f667343a56d4ad2 (patch)
treea64992df08c406302593c169a49b137f783d8ef1 /tty_notwindows.go
parent8f0d87986109ba3d02690aad2773e6512413dd1a (diff)
fix windows support
Diffstat (limited to 'tty_notwindows.go')
-rw-r--r--tty_notwindows.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/tty_notwindows.go b/tty_notwindows.go
new file mode 100644
index 0000000..77d4ef4
--- /dev/null
+++ b/tty_notwindows.go
@@ -0,0 +1,18 @@
+//go:build !windows
+// +build !windows
+
+package main
+
+import (
+ "github.com/gdamore/tcell/v2"
+)
+
+func opentty() (tty tcell.Tty, err error) {
+ device := ttyDevice()
+ debugLog.Println("Using tty device:", device)
+ tty, err = tcell.NewDevTtyFromDev(device)
+ if err == nil {
+ err = tty.Start()
+ }
+ return
+}