summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mode-key.c8
-rw-r--r--status.c6
-rw-r--r--tmux.11
-rw-r--r--tmux.h1
4 files changed, 16 insertions, 0 deletions
diff --git a/mode-key.c b/mode-key.c
index 9e5720eb..b037f281 100644
--- a/mode-key.c
+++ b/mode-key.c
@@ -110,6 +110,12 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key)
return (MODEKEYCMD_BACKTOINDENTATION);
case '\033':
return (MODEKEYCMD_CLEARSELECTION);
+ case 'C':
+ if (mdata->flags & MODEKEY_CANEDIT)
+ mdata->flags |= MODEKEY_EDITMODE;
+ return (MODEKEYCMD_DELETETOENDOFLINE);
+ case 'D':
+ return (MODEKEYCMD_DELETETOENDOFLINE);
case 'j':
case KEYC_DOWN:
return (MODEKEYCMD_DOWN);
@@ -169,6 +175,8 @@ mode_key_lookup_emacs(struct mode_key_data *mdata, int key)
case '\027':
case 'w' | KEYC_ESCAPE:
return (MODEKEYCMD_COPYSELECTION);
+ case '\013':
+ return (MODEKEYCMD_DELETETOENDOFLINE);
case '\016':
case KEYC_DOWN:
return (MODEKEYCMD_DOWN);
diff --git a/status.c b/status.c
index 24d91204..a7aa4a6c 100644
--- a/status.c
+++ b/status.c
@@ -823,6 +823,12 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
}
break;
+ case MODEKEYCMD_DELETETOENDOFLINE:
+ if (c->prompt_index < size) {
+ c->prompt_buffer[c->prompt_index] = '\0';
+ c->flags |= CLIENT_STATUS;
+ }
+ break;
case MODEKEYCMD_UP:
if (server_locked)
break;
diff --git a/tmux.1 b/tmux.1
index 54e46a3d..0ba9eec9 100644
--- a/tmux.1
+++ b/tmux.1
@@ -331,6 +331,7 @@ The following keys are supported as appropriate for the mode:
.It Li "Cursor right" Ta "l" Ta "Right"
.It Li "Start selection" Ta "Space" Ta "C-Space"
.It Li "Cursor up" Ta "k" Ta "Up"
+.It Li "Delete to end of line" Ta "D or C" Ta "C-k"
.It Li "Paste buffer" Ta "p" Ta "C-y"
.El
.Pp
diff --git a/tmux.h b/tmux.h
index 046e6a19..01db8690 100644
--- a/tmux.h
+++ b/tmux.h
@@ -365,6 +365,7 @@ enum mode_key_cmd {
MODEKEYCMD_COMPLETE,
MODEKEYCMD_COPYSELECTION,
MODEKEYCMD_DELETE,
+ MODEKEYCMD_DELETETOENDOFLINE,
MODEKEYCMD_DOWN,
MODEKEYCMD_ENDOFLINE,
MODEKEYCMD_LEFT,