diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-09 08:19:51 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-09 08:21:39 -0600 |
commit | 7fe134307ecc585377ff195663eacc0f07a57494 (patch) | |
tree | a7fd67d00db3d4af5b9cc3d277d396a895afa0f4 /apps/interpreters | |
parent | 0605a6caed06520098dc7bb4ca0455548098b51f (diff) | |
download | px4-nuttx-7fe134307ecc585377ff195663eacc0f07a57494.tar.gz px4-nuttx-7fe134307ecc585377ff195663eacc0f07a57494.tar.bz2 px4-nuttx-7fe134307ecc585377ff195663eacc0f07a57494.zip |
BAS: Accept either BS or DEL as the backspace charactger
Diffstat (limited to 'apps/interpreters')
-rw-r--r-- | apps/interpreters/bas/fs.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/interpreters/bas/fs.c b/apps/interpreters/bas/fs.c index 5895dc5c0..9f3489755 100644 --- a/apps/interpreters/bas/fs.c +++ b/apps/interpreters/bas/fs.c @@ -78,6 +78,8 @@ #include <time.h> #include <unistd.h> +#include <nuttx/ascii.h> + #include "vt100.h" #include "fs.h" @@ -282,7 +284,16 @@ static int edit(int chn, int onl) return -1; } - if (ch == '\b') + /* Check for backspace + * + * There are several notions of backspace, for an elaborate summary see + * http://www.ibb.net/~anne/keyboard.html. There is no clean solution. + * Here both DEL and backspace are treated like backspace here. The + * Unix/Linux screen terminal by default outputs DEL (0x7f) when the + * backspace key is pressed. + */ + + if (ch == ASCII_BS || ch == ASCII_DEL) { if (f->inCapacity) { |