Add ctrl+k

This commit is contained in:
savalet
2025-05-23 15:49:26 +02:00
parent 25cef3f846
commit b13343a31a
2 changed files with 4 additions and 1 deletions

View File

@@ -35,7 +35,9 @@ bool handle_key_ctrl_f(readline_helper_t *rh, exec_ctx_t *ec, buff_t *buff)
bool handle_key_ctrl_k(readline_helper_t *rh, exec_ctx_t *, buff_t *buff)
{
if (!buff->sz && !rh->cursor)
return false;
buff->sz = rh->cursor;
refresh_line(rh);
return true;
return false;
}

View File

@@ -30,6 +30,7 @@ const key_handler_t KEY_HANDLERS[] = {
{"\027", handle_key_ctrl_w}, // ^W
{"\031", handle_key_ctrl_y}, // ^Y
{"\022", handle_key_ctrl_r}, // ^R
{"\013", handle_key_ctrl_k}, // ^K
{ESC "[A", handle_key_arrow_up},
{ESC "[B", handle_key_arrow_down},
{ESC "[C", handle_key_arrow_right},