aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-05-05 20:18:41 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-05-05 20:18:41 +0200
commite542aa5accdc6559b7b8ae6005f5322492676e08 (patch)
tree96da2129e6be0d13bdc8124630a5e47e3fe2f9d2
parentfa0ee9d65bca974cbaf85d1f0599a068ffc5ff48 (diff)
downloadxK-e542aa5accdc6559b7b8ae6005f5322492676e08.tar.gz
xK-e542aa5accdc6559b7b8ae6005f5322492676e08.tar.xz
xK-e542aa5accdc6559b7b8ae6005f5322492676e08.zip
degesch: some libedit fixes
-rw-r--r--degesch.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index f845129..d689a0c 100644
--- a/degesch.c
+++ b/degesch.c
@@ -413,8 +413,9 @@ input_ding (struct input *self)
{
(void) self;
- // XXX: this isn't probably very portable
- putc ('\a', stdout);
+ // XXX: this isn't probably very portable;
+ // we could use "bell" from terminfo but that creates a dependency
+ write (STDOUT_FILENO, "\a", 1);
}
static void
@@ -490,6 +491,9 @@ input_start (struct input *self, const char *program_name)
el_set (self->editline, EL_UNBUFFERED, true);
el_set (self->editline, EL_EDITOR, "emacs");
+ // No, editline, it's not supposed to kill the entire line
+ el_set (self->editline, EL_BIND, "^W", "ed-delete-prev-word", NULL);
+
app_editline_init (self);
self->prompt_shown = 1;
self->active = true;
@@ -613,7 +617,11 @@ input_on_readable (struct input *self)
// The character is VEOF (usually C-d)
// TODO: read it from terminal info
if (count == 0 && buf[0] == ('D' - 'A' + 1))
+ {
+ el_deletestr (self->editline, 1);
+ input_redisplay (self);
input_ding (self);
+ }
}
#endif // HAVE_EDITLINE