[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] [PATCH] Add CTRL-K support to cmdedit.c
From:       "Vladimir N. Oleynik" <dzo () simtreas ! ru>
Date:       2002-03-29 4:56:03
[Download RAW message or body]

Jim,
 
> Oops. :)  How about this one?
> 
> --- ./cmdedit.c.orig    Thu Mar 28 04:46:47 2002
> +++ ./cmdedit.c Thu Mar 28 17:33:08 2002
> @@ -1263,16 +1263,20 @@
>                         input_tab(&lastWasTab);
>  #endif
>                         break;
> -               case 12:
> -                       /* Control-l -- clear screen
> -                        * if the len=0 and no chars in edit line */
> -                       if (len == 0) {
> -                               printf("\033[H\033[J");
> -                               put_prompt();
> -                       } else {
> -                               beep();
> -                       }
> +               case 11:
> +                       /* Control-k -- clear to end of line */
> +                       *(command + cursor) = 0;
> +                       len = cursor;
> +                       redraw(cmdedit_y, 0);
>                         break;
> +               case 12: {
> +                       /* Control-l -- clear screen */
> +                       int old_cursor = cursor;
> +                       printf("\033[H");
> +                       cursor = 0;
> +                       redraw(0, len-old_cursor);
> +                       break;
> +               }

It is possible to remove also cursor=0 :). 
I all the same can not write down it in CVS.  


--w
vodz

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic