diff --git a/TODO b/TODO index 0391ee67..865472bb 100644 --- a/TODO +++ b/TODO @@ -20,3 +20,4 @@ - some of the uses of buffers really sucks. buffer_reverse_add/remove, and buffer_insert_range/delete_range are abominations. this should be rethought +- figure out once and for all what is going on with backspace and del diff --git a/input.c b/input.c index 8441bae1..6dc44ecc 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.4 2007-08-28 09:19:50 nicm Exp $ */ +/* $Id: input.c,v 1.5 2007-09-21 19:24:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -48,29 +48,29 @@ struct input_key { }; struct input_key input_keys[] = { - { KEYC_BACKSPACE, "" }, - { KEYC_DC, "[3~" }, - { KEYC_DOWN, "OB" }, - { KEYC_F1, "OP" }, - { KEYC_F10, "[21~" }, - { KEYC_F11, "[23~" }, - { KEYC_F12, "[24~" }, - { KEYC_F2, "OQ" }, - { KEYC_F3, "OR" }, - { KEYC_F4, "OS" }, - { KEYC_F5, "[15~" }, - { KEYC_F6, "[17~" }, - { KEYC_F7, "[18~" }, - { KEYC_F8, "[19~" }, - { KEYC_F9, "[20~" }, - { KEYC_HOME, "[1~" }, - { KEYC_IC, "[2~" }, - { KEYC_LEFT, "OD" }, - { KEYC_LL, "[4~" }, - { KEYC_NPAGE, "[6~" }, - { KEYC_PPAGE, "[5~" }, - { KEYC_RIGHT, "OC" }, - { KEYC_UP, "OA" } +/* { KEYC_BACKSPACE, "\010" }, */ + { KEYC_DC, "\e[3~" }, + { KEYC_DOWN, "\eOB" }, + { KEYC_F1, "\eOP" }, + { KEYC_F10, "\e[21~" }, + { KEYC_F11, "\e[23~" }, + { KEYC_F12, "\e[24~" }, + { KEYC_F2, "\eOQ" }, + { KEYC_F3, "\eOR" }, + { KEYC_F4, "\eOS" }, + { KEYC_F5, "\e[15~" }, + { KEYC_F6, "\e[17~" }, + { KEYC_F7, "\e[18~" }, + { KEYC_F8, "\e[19~" }, + { KEYC_F9, "\e[20~" }, + { KEYC_HOME, "\e[1~" }, + { KEYC_IC, "\e[2~" }, + { KEYC_LEFT, "\eOD" }, + { KEYC_LL, "\e[4~" }, + { KEYC_NPAGE, "\e[6~" }, + { KEYC_PPAGE, "\e[5~" }, + { KEYC_RIGHT, "\eOC" }, + { KEYC_UP, "\eOA" } }; /* diff --git a/local.c b/local.c index 8ba0c340..648e70bc 100644 --- a/local.c +++ b/local.c @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.6 2007-09-20 09:43:33 nicm Exp $ */ +/* $Id: local.c,v 1.7 2007-09-21 19:24:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -49,7 +49,7 @@ struct local_key local_keys[] = { { "ka1", NULL, 0, KEYC_A1 }, { "ka3", NULL, 0, KEYC_A3 }, { "kb2", NULL, 0, KEYC_B2 }, - { "kbs", NULL, 0, KEYC_BACKSPACE }, +/* { "kbs", NULL, 0, KEYC_BACKSPACE }, */ { "kbeg", NULL, 0, KEYC_BEG }, { "kcbt", NULL, 0, KEYC_BTAB }, { "kc1", NULL, 0, KEYC_C1 }, @@ -348,7 +348,8 @@ local_key(size_t *used) if (strncmp(BUFFER_OUT(local_in), lk->string, size) == 0) { if (size < lk->size) return (KEYC_NONE); - log_debug("got key: %s %d", lk->name, lk->code); + log_debug("got key: " + "%s %d \"%s\"", lk->name, lk->code, lk->string); buffer_remove(local_in, lk->size); if (used != NULL) *used = lk->size; diff --git a/screen.c b/screen.c index 7ca722bb..1d968e4f 100644 --- a/screen.c +++ b/screen.c @@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.10 2007-09-21 18:00:58 nicm Exp $ */ +/* $Id: screen.c,v 1.11 2007-09-21 19:24:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -395,6 +395,9 @@ screen_character(struct screen *s, u_char ch) if (s->cx > 0) s->cx--; break; + case '\177': /* DC */ + /* XXX */ + break; default: if (ch < ' ') fatalx("bad control"); diff --git a/server.c b/server.c index 7dd68769..b56ec012 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.9 2007-09-20 18:03:23 nicm Exp $ */ +/* $Id: server.c,v 1.10 2007-09-21 19:24:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -575,6 +575,12 @@ user_input(struct client *c, size_t in) case '\005': key = KEYC_LL; goto again; + case '\010': + key = KEYC_BACKSPACE; + goto again; + case '\177': + key = KEYC_DC; + goto again; case '\013': c->buf[c->idx + 1] = '\0'; input_store_zero(c->out, CODE_CURSOROFF);