diff --git a/cook-port.rkt b/cook-port.rkt index cbca4d9..a9158f4 100644 --- a/cook-port.rkt +++ b/cook-port.rkt @@ -22,9 +22,10 @@ (define (update-buffer b key prompt k-eof k-complete k-ongoing) (case key - ((#\backspace) (if (buffer-empty? b) - (k-ongoing b "") - (k-ongoing (buffer-adjust b (cdr (buffer-chars b))) "\b \b"))) + ((#\backspace #\rubout) ;; backspace = ^H = code 8; delete = code 127 + (if (buffer-empty? b) + (k-ongoing b "") + (k-ongoing (buffer-adjust b (cdr (buffer-chars b))) "\b \b"))) ((#\return) (k-complete (buffer-contents b) (buffer '() #t))) ((#\newline) (if (buffer-consume-next-linefeed? b) (k-ongoing (struct-copy buffer b [consume-next-linefeed? #f]) "")