update test
This commit is contained in:
9
test.go
9
test.go
@@ -4,12 +4,17 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"terminal"
|
|
||||||
|
"github.com/carmark/pseudo-terminal-go/terminal"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
term, _ := terminal.NewWithStdInOut()
|
term, err := terminal.NewWithStdInOut()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
defer term.ReleaseFromStdInOut() // defer this
|
defer term.ReleaseFromStdInOut() // defer this
|
||||||
|
fmt.Println("Ctrl-D to break")
|
||||||
term.SetPrompt("root@hello: # ")
|
term.SetPrompt("root@hello: # ")
|
||||||
line, err:= term.ReadLine()
|
line, err:= term.ReadLine()
|
||||||
for {
|
for {
|
||||||
|
|||||||
Reference in New Issue
Block a user