mirror of https://github.com/chzyer/readline.git
example: change (Ctrl+C), (Ctrl+D) to shell-like
This commit is contained in:
parent
db2e5eae91
commit
5660cc8cb6
|
@ -49,6 +49,8 @@ func main() {
|
|||
Prompt: "\033[31m»\033[0m ",
|
||||
HistoryFile: "/tmp/readline.tmp",
|
||||
AutoComplete: completer,
|
||||
InterruptPrompt: "\nInterrupt",
|
||||
EOFPrompt: "exit",
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -58,7 +60,7 @@ func main() {
|
|||
log.SetOutput(l.Stderr())
|
||||
for {
|
||||
line, err := l.Readline()
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
line = strings.TrimSpace(line)
|
||||
|
|
Loading…
Reference in New Issue