diff --git a/prompt.go b/prompt.go index b342905d..bcb1623a 100644 --- a/prompt.go +++ b/prompt.go @@ -256,10 +256,10 @@ func (p *Prompt) readBuffer(bufCh chan []byte, stopCh chan struct{}) { if b, err := p.in.Read(); err == nil && !(len(b) == 1 && b[0] == 0) { start := 0 for i, e := range b { - switch GetKey([] byte{e}) { - case Enter, ControlJ, ControlM: + switch GetKey([]byte{e}) { + case Enter, ControlJ, ControlM: bufCh <- b[start:i] - bufCh <- [] byte{e} + bufCh <- []byte{e} start = i + 1 } }