Ctrl+d can now delete the current char

This commit is contained in:
savalet
2025-05-23 17:20:10 +02:00
parent 214d616420
commit d800631a07

View File

@@ -23,12 +23,14 @@ bool handle_key_ctrl_c(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff)
bool handle_key_ctrl_d(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff)
{
if (rh->cursor) {
if (rh->cursor && rh->cursor == buff->sz) {
WRITE_CONST(STDOUT_FILENO, "\n");
print_shell_prompt(ec);
refresh_line(rh);
return false;
}
if (buff->sz)
return handle_delete(rh, ec, buff);
if (ec->ignoreof)
return false;
buff->sz = 0;