mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
Add a key to delete to end of line at the prompt (^K in emacs mode, C/D in vi).
From Kalle Olavi Niemitalo.
This commit is contained in:
parent
fc65da1eed
commit
ad0aad21d5
@ -110,6 +110,12 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key)
|
|||||||
return (MODEKEYCMD_BACKTOINDENTATION);
|
return (MODEKEYCMD_BACKTOINDENTATION);
|
||||||
case '\033':
|
case '\033':
|
||||||
return (MODEKEYCMD_CLEARSELECTION);
|
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 'j':
|
||||||
case KEYC_DOWN:
|
case KEYC_DOWN:
|
||||||
return (MODEKEYCMD_DOWN);
|
return (MODEKEYCMD_DOWN);
|
||||||
@ -169,6 +175,8 @@ mode_key_lookup_emacs(struct mode_key_data *mdata, int key)
|
|||||||
case '\027':
|
case '\027':
|
||||||
case 'w' | KEYC_ESCAPE:
|
case 'w' | KEYC_ESCAPE:
|
||||||
return (MODEKEYCMD_COPYSELECTION);
|
return (MODEKEYCMD_COPYSELECTION);
|
||||||
|
case '\013':
|
||||||
|
return (MODEKEYCMD_DELETETOENDOFLINE);
|
||||||
case '\016':
|
case '\016':
|
||||||
case KEYC_DOWN:
|
case KEYC_DOWN:
|
||||||
return (MODEKEYCMD_DOWN);
|
return (MODEKEYCMD_DOWN);
|
||||||
|
6
status.c
6
status.c
@ -823,6 +823,12 @@ status_prompt_key(struct client *c, int key)
|
|||||||
c->flags |= CLIENT_STATUS;
|
c->flags |= CLIENT_STATUS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MODEKEYCMD_DELETETOENDOFLINE:
|
||||||
|
if (c->prompt_index < size) {
|
||||||
|
c->prompt_buffer[c->prompt_index] = '\0';
|
||||||
|
c->flags |= CLIENT_STATUS;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MODEKEYCMD_UP:
|
case MODEKEYCMD_UP:
|
||||||
if (server_locked)
|
if (server_locked)
|
||||||
break;
|
break;
|
||||||
|
1
tmux.1
1
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 "Cursor right" Ta "l" Ta "Right"
|
||||||
.It Li "Start selection" Ta "Space" Ta "C-Space"
|
.It Li "Start selection" Ta "Space" Ta "C-Space"
|
||||||
.It Li "Cursor up" Ta "k" Ta "Up"
|
.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"
|
.It Li "Paste buffer" Ta "p" Ta "C-y"
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
|
1
tmux.h
1
tmux.h
@ -365,6 +365,7 @@ enum mode_key_cmd {
|
|||||||
MODEKEYCMD_COMPLETE,
|
MODEKEYCMD_COMPLETE,
|
||||||
MODEKEYCMD_COPYSELECTION,
|
MODEKEYCMD_COPYSELECTION,
|
||||||
MODEKEYCMD_DELETE,
|
MODEKEYCMD_DELETE,
|
||||||
|
MODEKEYCMD_DELETETOENDOFLINE,
|
||||||
MODEKEYCMD_DOWN,
|
MODEKEYCMD_DOWN,
|
||||||
MODEKEYCMD_ENDOFLINE,
|
MODEKEYCMD_ENDOFLINE,
|
||||||
MODEKEYCMD_LEFT,
|
MODEKEYCMD_LEFT,
|
||||||
|
Loading…
Reference in New Issue
Block a user