mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Make C-[ have the same bindings as Escape for terminals with extended
keys where they are different, GitHub issue 5035 from Eric NICOLAS.
This commit is contained in:
@@ -512,6 +512,7 @@ key_bindings_init(void)
|
|||||||
"bind -Tcopy-mode C-v { send -X page-down }",
|
"bind -Tcopy-mode C-v { send -X page-down }",
|
||||||
"bind -Tcopy-mode C-w { send -X copy-pipe-and-cancel }",
|
"bind -Tcopy-mode C-w { send -X copy-pipe-and-cancel }",
|
||||||
"bind -Tcopy-mode Escape { send -X cancel }",
|
"bind -Tcopy-mode Escape { send -X cancel }",
|
||||||
|
"bind -Tcopy-mode C-[ { send -X cancel }",
|
||||||
"bind -Tcopy-mode Space { send -X page-down }",
|
"bind -Tcopy-mode Space { send -X page-down }",
|
||||||
"bind -Tcopy-mode , { send -X jump-reverse }",
|
"bind -Tcopy-mode , { send -X jump-reverse }",
|
||||||
"bind -Tcopy-mode \\; { send -X jump-again }",
|
"bind -Tcopy-mode \\; { send -X jump-again }",
|
||||||
@@ -585,6 +586,7 @@ key_bindings_init(void)
|
|||||||
"bind -Tcopy-mode-vi C-v { send -X rectangle-toggle }",
|
"bind -Tcopy-mode-vi C-v { send -X rectangle-toggle }",
|
||||||
"bind -Tcopy-mode-vi C-y { send -X scroll-up }",
|
"bind -Tcopy-mode-vi C-y { send -X scroll-up }",
|
||||||
"bind -Tcopy-mode-vi Escape { send -X clear-selection }",
|
"bind -Tcopy-mode-vi Escape { send -X clear-selection }",
|
||||||
|
"bind -Tcopy-mode-vi C-[ { send -X clear-selection }",
|
||||||
"bind -Tcopy-mode-vi Space { send -X begin-selection }",
|
"bind -Tcopy-mode-vi Space { send -X begin-selection }",
|
||||||
"bind -Tcopy-mode-vi '$' { send -X end-of-line }",
|
"bind -Tcopy-mode-vi '$' { send -X end-of-line }",
|
||||||
"bind -Tcopy-mode-vi , { send -X jump-reverse }",
|
"bind -Tcopy-mode-vi , { send -X jump-reverse }",
|
||||||
|
|||||||
1
menu.c
1
menu.c
@@ -471,6 +471,7 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
|
|||||||
case '\r':
|
case '\r':
|
||||||
goto chosen;
|
goto chosen;
|
||||||
case '\033': /* Escape */
|
case '\033': /* Escape */
|
||||||
|
case '['|KEYC_CTRL:
|
||||||
case 'c'|KEYC_CTRL:
|
case 'c'|KEYC_CTRL:
|
||||||
case 'g'|KEYC_CTRL:
|
case 'g'|KEYC_CTRL:
|
||||||
case 'q':
|
case 'q':
|
||||||
|
|||||||
@@ -1276,6 +1276,7 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
|
|||||||
switch (*key) {
|
switch (*key) {
|
||||||
case 'q':
|
case 'q':
|
||||||
case '\033': /* Escape */
|
case '\033': /* Escape */
|
||||||
|
case '['|KEYC_CTRL:
|
||||||
case 'g'|KEYC_CTRL:
|
case 'g'|KEYC_CTRL:
|
||||||
return (1);
|
return (1);
|
||||||
case KEYC_F1:
|
case KEYC_F1:
|
||||||
|
|||||||
3
status.c
3
status.c
@@ -1053,6 +1053,7 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
|||||||
*new_key = key;
|
*new_key = key;
|
||||||
return (1);
|
return (1);
|
||||||
case '\033': /* Escape */
|
case '\033': /* Escape */
|
||||||
|
case '['|KEYC_CTRL:
|
||||||
c->prompt_mode = PROMPT_COMMAND;
|
c->prompt_mode = PROMPT_COMMAND;
|
||||||
if (c->prompt_index != 0)
|
if (c->prompt_index != 0)
|
||||||
c->prompt_index--;
|
c->prompt_index--;
|
||||||
@@ -1085,6 +1086,7 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
|||||||
c->flags |= CLIENT_REDRAWSTATUS;
|
c->flags |= CLIENT_REDRAWSTATUS;
|
||||||
return (0);
|
return (0);
|
||||||
case '\033': /* Escape */
|
case '\033': /* Escape */
|
||||||
|
case '['|KEYC_CTRL:
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1652,6 +1654,7 @@ process_key:
|
|||||||
free(s);
|
free(s);
|
||||||
break;
|
break;
|
||||||
case '\033': /* Escape */
|
case '\033': /* Escape */
|
||||||
|
case '['|KEYC_CTRL:
|
||||||
case 'c'|KEYC_CTRL:
|
case 'c'|KEYC_CTRL:
|
||||||
case 'g'|KEYC_CTRL:
|
case 'g'|KEYC_CTRL:
|
||||||
if (c->prompt_inputcb(c, c->prompt_data, NULL, 1) == 0)
|
if (c->prompt_inputcb(c, c->prompt_data, NULL, 1) == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user