From d9b7866716ffba8f58845b7b864d8a0ee1c3d4b1 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 30 Jan 2013 23:38:06 -0500 Subject: [PATCH] fix backspace (it wraps and doesn't clear) --- terminal.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/terminal.coffee b/terminal.coffee index 751a53a..37d3971 100644 --- a/terminal.coffee +++ b/terminal.coffee @@ -83,10 +83,12 @@ class Terminal when '\x0d' # cr @x = 0 when '\x08' # backspace - if @x > 0 + if @x is 0 + @x = @width - 1 + if @y > 0 + @y -= 1 + else @x -= 1 - @text[@y][@x] = ' ' - # should this set the attribute too? when '\x0a', '\x0b' # lf, vertical tab (same thing) @wrap_to_next_line() else -- 1.7.10.4