initial work: basic functionality

This commit is contained in:
2023-07-22 20:10:24 +10:00
commit a3e50949f4
9 changed files with 255 additions and 0 deletions

38
test/cmd/cmd.go Normal file
View File

@@ -0,0 +1,38 @@
package main
import (
tw "gitea.suyono.dev/suyono/terminal_wrapper"
"os"
)
func main() {
var (
t *tw.Terminal
pass string
err error
)
if t, err = tw.MakeTerminal(os.Stderr); err != nil {
panic(err)
}
defer func() {
if err = t.Restore(); err != nil {
panic(err)
}
}()
cursor := t.Cursor()
//t.ClearScreen()
//cursor.GoHome()
t.ClearLine()
cursor.GoUp(1)
t.ClearLine()
cursor.GoUp(1)
t.ClearLine()
if pass, err = t.ReadPassword("input passphrase: "); err != nil {
panic(err)
}
t.Print("password: ", pass)
}