[shell] Redraw prompt on ^L
This commit is contained in:
parent
63f57855bf
commit
65e6b0e800
@ -162,6 +162,7 @@ int kgets_collected = 0;
|
||||
int kgets_want = 0;
|
||||
int kgets_newline = 0;
|
||||
int kgets_cancel = 0;
|
||||
kgets_redraw_t kgets_redraw_func = NULL;
|
||||
|
||||
static void
|
||||
kwrite(
|
||||
@ -192,6 +193,9 @@ kgets_handler(
|
||||
return;
|
||||
} else if (ch == '\x0c') {
|
||||
kprintf("\033[J");
|
||||
if (kgets_redraw_func) {
|
||||
kgets_redraw_func();
|
||||
}
|
||||
kprintf(kgets_buffer);
|
||||
return;
|
||||
} else if (ch == '\n') {
|
||||
@ -234,6 +238,7 @@ kgets(
|
||||
buffer[kgets_collected] = '\0';
|
||||
/* Disable the buffer */
|
||||
keyboard_buffer_handler = NULL;
|
||||
kgets_redraw_func = NULL;
|
||||
/* Return the string */
|
||||
return kgets_collected;
|
||||
}
|
||||
|
@ -328,6 +328,7 @@ start_shell() {
|
||||
char buffer[1024];
|
||||
int size;
|
||||
/* Read commands */
|
||||
kgets_redraw_func = redraw_shell;
|
||||
size = kgets((char *)&buffer, 1023);
|
||||
if (size < 1) {
|
||||
continue;
|
||||
|
@ -125,6 +125,8 @@ extern void mouse_install();
|
||||
extern void kprintf(const char *fmt, ...);
|
||||
extern int sprintf(char *buf, const char *fmt, ...);
|
||||
extern int kgets(char *buf, int size);
|
||||
typedef void (*kgets_redraw_t)();
|
||||
extern kgets_redraw_t kgets_redraw_func;
|
||||
|
||||
/* Memory Management */
|
||||
extern uintptr_t placement_pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user