diff options
Diffstat (limited to 'cmdedit.c')
-rw-r--r-- | cmdedit.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -85,6 +85,12 @@ static int cmdedit_scroll = 27; /* width of EOL scrolling region */ | |||
85 | static int history_counter = 0; /* Number of commands in history list */ | 85 | static int history_counter = 0; /* Number of commands in history list */ |
86 | static int reset_term = 0; /* Set to true if the terminal needs to be reset upon exit */ | 86 | static int reset_term = 0; /* Set to true if the terminal needs to be reset upon exit */ |
87 | static int exithandler_set = 0; /* Set to true when atexit() has been called */ | 87 | static int exithandler_set = 0; /* Set to true when atexit() has been called */ |
88 | |||
89 | |||
90 | /* Link into lash to reset context to 0 | ||
91 | * on ^C and such */ | ||
92 | extern unsigned int shell_context; | ||
93 | |||
88 | 94 | ||
89 | struct history { | 95 | struct history { |
90 | char *s; | 96 | char *s; |
@@ -466,20 +472,24 @@ extern void cmdedit_read_input(char* prompt, char command[BUFSIZ]) | |||
466 | input_backward(outputFd, &cursor); | 472 | input_backward(outputFd, &cursor); |
467 | break; | 473 | break; |
468 | case 3: | 474 | case 3: |
469 | /* Control-c -- leave the current line, | 475 | /* Control-c -- stop gathering input */ |
470 | * and start over on the next line */ | 476 | |
477 | /* Link into lash to reset context to 0 on ^C and such */ | ||
478 | shell_context = 0; | ||
471 | 479 | ||
472 | /* Go to the next line */ | 480 | /* Go to the next line */ |
473 | xwrite(outputFd, "\n", 1); | 481 | xwrite(outputFd, "\n", 1); |
474 | 482 | ||
483 | #if 0 | ||
475 | /* Rewrite the prompt */ | 484 | /* Rewrite the prompt */ |
476 | xwrite(outputFd, prompt, strlen(prompt)); | 485 | xwrite(outputFd, prompt, strlen(prompt)); |
477 | 486 | ||
478 | /* Reset the command string */ | 487 | /* Reset the command string */ |
479 | memset(command, 0, BUFSIZ); | 488 | memset(command, 0, BUFSIZ); |
480 | len = cursor = 0; | 489 | len = cursor = 0; |
490 | #endif | ||
491 | return; | ||
481 | 492 | ||
482 | break; | ||
483 | case 4: | 493 | case 4: |
484 | /* Control-d -- Delete one character, or exit | 494 | /* Control-d -- Delete one character, or exit |
485 | * if the len=0 and no chars to delete */ | 495 | * if the len=0 and no chars to delete */ |