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
Steps to reproduce problem:
aaa
^A
Here's the code I used:
package main import ( "fmt" "github.com/chzyer/readline" ) func main() { rl, err := readline.New("> ") if err != nil { panic(err) } defer rl.Close() for { line, err := rl.Readline() if err != nil { break } println(line) } }
The text was updated successfully, but these errors were encountered:
Did you use ctrl + d to deleter characters?
https://github.com/chzyer/readline/blob/master/readline.go#L119-L123
if c.EOFPrompt == "" { c.EOFPrompt = "^D" } else if c.EOFPrompt == "\n" { c.EOFPrompt = "" }
As you can see, if you don't EOFPrompt field in Config structure, it will default to ^D
By the way, if you don't like how it reaches EOF with ^D, the following could be a fix:
for { line, err := rl.Readline() if err != nil { if err == io.EOF { continue } break } println(line) }
Sorry, something went wrong.
@hallazzang @BunnyBrewery I have the same issue and handling io.EOF solve it partially.
io.EOF
In my case delete key causes the same behavior as ctrl+d.
delete key
ctrl+d
I tried to change c.EOFPrompt through config but it didn't work. Did you found any other solution?
c.EOFPrompt
No branches or pull requests
Steps to reproduce problem:
aaa
^A
(Ctrl+A) to move cursor to the beginning of the lineHere's the code I used:
The text was updated successfully, but these errors were encountered: