kbdfs: support ^W word killing

cinap_lenrek 2011-06-15 12:34:30 +02:00
parent 675e74d30e
commit 21ede7960f
1 changed files with 7 additions and 4 deletions

View File

@ -568,16 +568,19 @@ lineproc(void *aux)
case '\0': /* flush */ case '\0': /* flush */
nr = 0; nr = 0;
continue; continue;
case '\b': /* backspace */ case Kbs: /* ^H: erase character */
case Knack: /* ^U */ case Knack: /* ^U: erase line */
case Ketb: /* ^W: erase word */
while(nr > 0){ while(nr > 0){
nr--; nr--;
fprint(1, "\b"); fprint(1, "\b");
if(r == '\b') if(r == Kbs)
break;
if(r == Ketb && utfrune(" \t", rb[nr]))
break; break;
} }
continue; continue;
case Keof: /* ^D */ case Keof: /* ^D: eof */
done = 1; done = 1;
break; break;
case '\n': case '\n':