summaryrefslogtreecommitdiffstats
path: root/src/hci/readline.c
diff options
context:
space:
mode:
authorMichael Brown2006-12-20 23:12:53 +0100
committerMichael Brown2006-12-20 23:12:53 +0100
commitc5df1bc7df8a2a79bbb93dd3d6f38a93646469af (patch)
treecd2ad9aec264fb176316eda320f0c4744433aaca /src/hci/readline.c
parentSome key sequences seem to end with a tilde (diff)
downloadipxe-c5df1bc7df8a2a79bbb93dd3d6f38a93646469af.tar.gz
ipxe-c5df1bc7df8a2a79bbb93dd3d6f38a93646469af.tar.xz
ipxe-c5df1bc7df8a2a79bbb93dd3d6f38a93646469af.zip
Use getkey() and symbolic key names.
Diffstat (limited to 'src/hci/readline.c')
-rw-r--r--src/hci/readline.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/hci/readline.c b/src/hci/readline.c
index 14dbeafe..4fac0986 100644
--- a/src/hci/readline.c
+++ b/src/hci/readline.c
@@ -19,6 +19,7 @@
#include <string.h>
#include <stdlib.h>
#include <console.h>
+#include <gpxe/keys.h>
#include <gpxe/editstring.h>
#include <readline/readline.h>
@@ -92,17 +93,17 @@ char * readline ( const char *prompt ) {
buf[0] = '\0';
while ( 1 ) {
- key = edit_string ( &string, getchar() );
+ key = edit_string ( &string, getkey() );
sync_console ( &string );
switch ( key ) {
- case 0x0d: /* Carriage return */
- case 0x0a: /* Line feed */
+ case CR:
+ case LF:
putchar ( '\n' );
line = strdup ( buf );
if ( ! line )
printf ( "Out of memory\n" );
return line;
- case 0x03: /* Ctrl-C */
+ case CTRL_C:
putchar ( '\n' );
return NULL;
default: