Skip to content

A terminal handler for reading a line with history. A fork of bitbucket.org/binet/go-terminal which forks code.google.com/p/go.crypto/ssh/terminal

License

Notifications You must be signed in to change notification settings

torlangballe/terminal

Repository files navigation

terminal

A go-native terminal handler for reading a line with history.

A fork of bitbucket.org/binet/go-terminal which forks code.google.com/p/go.crypto/ssh/terminal

It allows editing a line with arrow keys, and history using up/down arrow keys.

bitbucket.org/binet/go-terminal added some history.

This repo fixed/adds:

  • functions to set up from stdin/out
  • history line slice copying bug
  • and history list getting/setting.

Usage:

term := terminal.NewWithStdInOut()  
term.ReleaseFromStdInOut() // defer this  
term.SetPrompt(prompt string)  
term.ReadLine() (line string, err error)  
term.ReadPassword(prompt string) (line string, err error)  
term.SetHistory([]string)  
term.GetHistory() (h []string)  
term.Write(buf []byte) (n int, err error)  

About

A terminal handler for reading a line with history. A fork of bitbucket.org/binet/go-terminal which forks code.google.com/p/go.crypto/ssh/terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages