update test

This commit is contained in:
Lei Xue
2015-11-06 17:31:36 +08:00
parent d9b6d47b66
commit 5a48ae24c6

View File

@@ -4,12 +4,17 @@ import (
"io"
"fmt"
"strings"
"terminal"
"github.com/carmark/pseudo-terminal-go/terminal"
)
func main() {
term, _ := terminal.NewWithStdInOut()
term, err := terminal.NewWithStdInOut()
if err != nil {
panic(err)
}
defer term.ReleaseFromStdInOut() // defer this
fmt.Println("Ctrl-D to break")
term.SetPrompt("root@hello: # ")
line, err:= term.ReadLine()
for {