We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am working on a small example that uses the readline package
When I enter each number 1,2,3 and use the arrow keys to navigate the history, I get the sequence 2,3,2,1
$ go run cli.go >1 1 >2 2 >3 3 1
When I restart the program and enter A then this entry is not showing in the history. I was expecting this.
Maybe I setup the program wrong. (what is the role of the ps2 argument in NewLine?)
package main import ( "fmt" "log" "os" "path" "github.com/kless/term" "github.com/kless/term/readline" ) var historyFile = path.Join(os.TempDir(), "test_history") func main() { hist, err := readline.NewHistoryOfSize(historyFile, 10) if err != nil { log.Fatal("could not create history", err) } ter, _ := term.New() defer func() { if err := ter.Restore(); err != nil { log.Print(err) } }() l, err := readline.NewLine(ter, ">", "?", 1, hist) if err != nil { log.Fatal("NewLine failed", err) } for { entry, err := l.Read() if err != nil { log.Fatal("Read failed", err) } if entry == "exit" || entry == "quit" { break } fmt.Println(entry) } }
The text was updated successfully, but these errors were encountered:
Yes, there is an issue in the history. But I have no time to fix it. Sorry! Anyway, I accept code that could fix it.
Sorry, something went wrong.
I will try to fix this problem as well as adding the search in history with Ctrl+r as in GNU Readline.
@kless would you accept this changes?
@ElPincheTopo Yes, I'd accept them.
No branches or pull requests
I am working on a small example that uses the readline package
When I enter each number 1,2,3 and use the arrow keys to navigate the history, I get the sequence 2,3,2,1
When I restart the program and enter A then this entry is not showing in the history. I was expecting this.
Maybe I setup the program wrong. (what is the role of the ps2 argument in NewLine?)
The text was updated successfully, but these errors were encountered: