aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-04-07 13:35:43 +0100
committerRon Yorston <rmy@pobox.com>2014-04-07 13:35:43 +0100
commitc8f20188ae14ce2f9da8d263fbefbe88bda16075 (patch)
tree7f880d58ec79aa3903d9f0c7945249d43dda4db9
parentfee58ea68cdd08e7fb298960e12b2c921254a75b (diff)
downloadbusybox-w32-c8f20188ae14ce2f9da8d263fbefbe88bda16075.tar.gz
busybox-w32-c8f20188ae14ce2f9da8d263fbefbe88bda16075.tar.bz2
busybox-w32-c8f20188ae14ce2f9da8d263fbefbe88bda16075.zip
Use ANSI escape to move cursor back during line editing
BusyBox attempts to optimise for slow terminals by using backspace for small movements. In the Windows console this results in the cursor becoming invisible during backward movement.
-rw-r--r--libbb/lineedit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 4cb9eba4b..a49149921 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -465,6 +465,7 @@ static void input_backward(unsigned num)
465 465
466 if (cmdedit_x >= num) { 466 if (cmdedit_x >= num) {
467 cmdedit_x -= num; 467 cmdedit_x -= num;
468#if !ENABLE_PLATFORM_MINGW32
468 if (num <= 4) { 469 if (num <= 4) {
469 /* This is longer by 5 bytes on x86. 470 /* This is longer by 5 bytes on x86.
470 * Also gets miscompiled for ARM users 471 * Also gets miscompiled for ARM users
@@ -477,6 +478,7 @@ static void input_backward(unsigned num)
477 } while (--num); 478 } while (--num);
478 return; 479 return;
479 } 480 }
481#endif
480 printf(ESC"[%uD", num); 482 printf(ESC"[%uD", num);
481 return; 483 return;
482 } 484 }