Skip to content

Instantly share code, notes, and snippets.

@skywind3000
Last active January 23, 2018 07:20
Show Gist options
  • Save skywind3000/4efdb6975821b180310174a2e7dc9581 to your computer and use it in GitHub Desktop.
Save skywind3000/4efdb6975821b180310174a2e7dc9581 to your computer and use it in GitHub Desktop.
Patch to fix Backspace for Windows Console Vim
diff --git a/src/os_win32.c b/src/os_win32.c
index f2fd808e9..323bdcd7c 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -807,6 +807,7 @@ static const struct
{ VK_NEXT, TRUE, 'Q', '\322', 'v', '\323', }, /*PgDn*/
{ VK_INSERT,TRUE, 'R', '\324', '\325', '\326', },
{ VK_DELETE,TRUE, 'S', '\327', '\330', '\331', },
+ { VK_BACK, TRUE, '\x7f', 0, 0, 0, },
{ VK_SNAPSHOT,TRUE, 0, 0, 0, 'r', }, /*PrtScrn*/
diff --git a/src/term.c b/src/term.c
index 989d6b7af..ffc15b506 100644
--- a/src/term.c
+++ b/src/term.c
@@ -633,6 +633,7 @@ static struct builtin_term builtin_termcaps[] =
{K_K7, "\316\366"},
{K_K8, "\316\372"},
{K_K9, "\316\376"},
+ {K_BS, "\316\x7f"},
# endif
# if defined(VMS) || defined(ALL_BUILTIN_TCAPS)
#include <stdio.h>
int main(void)
{
return 0;
}
@skywind3000
Copy link
Author

hehe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment