With status-keys vi, move the cursor left by one when pressing Escape to

enter command mode, like vi. GitHub issue 4767 from Joshua Cooper.
This commit is contained in:
nicm
2025-12-22 08:39:35 +00:00
parent 188f963fe0
commit a22ec275b4

View File

@@ -936,6 +936,8 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
return (1);
case '\033': /* Escape */
c->prompt_mode = PROMPT_COMMAND;
if (c->prompt_index != 0)
c->prompt_index--;
c->flags |= CLIENT_REDRAWSTATUS;
return (0);
}
@@ -961,10 +963,11 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
*new_key = 'u'|KEYC_CTRL;
return (1);
case 'i':
case '\033': /* Escape */
c->prompt_mode = PROMPT_ENTRY;
c->flags |= CLIENT_REDRAWSTATUS;
return (0);
case '\033': /* Escape */
return (0);
}
switch (key) {