backport: vi: save/restore screen upon invocation
authorDennis Groenen <tj.groenen@gmail.com>
Sat, 23 Jun 2012 10:10:19 +0000 (12:10 +0200)
committerDennis Groenen <tj.groenen@gmail.com>
Sat, 23 Jun 2012 10:10:19 +0000 (12:10 +0200)
debian/patches/patches-backports/0001-backport-vi-save-restore-screen-upon-invocation.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/patches-backports/0001-backport-vi-save-restore-screen-upon-invocation.patch b/debian/patches/patches-backports/0001-backport-vi-save-restore-screen-upon-invocation.patch
new file mode 100644 (file)
index 0000000..885c205
--- /dev/null
@@ -0,0 +1,33 @@
+From 5b7472b9b70a16201bcaa4cb69c617c19b889b77 Mon Sep 17 00:00:00 2001
+From: Dennis Groenen <tj.groenen@gmail.com>
+Date: Fri, 22 Jun 2012 21:49:21 +0200
+Subject: [PATCH] backport: vi: save/restore screen upon invocation
+
+Backport of git commit d3dff879f0683c2a4119f694c1b20c96ee030a26
+---
+ editors/vi.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/editors/vi.c b/editors/vi.c
+index b4ad12e..8aea2e2 100644
+--- a/editors/vi.c
++++ b/editors/vi.c
+@@ -603,11 +603,15 @@ int vi_main(int argc, char **argv)
+       optind = 0;
+       //----- This is the main file handling loop --------------
++      // "Save cursor, use alternate screen buffer, clear screen"
++      write1("\033[?1049h");
+       while (1) {
+               edit_file(argv[optind]); /* param might be NULL */
+               if (++optind >= argc)
+                       break;
+       }
++      // "Use normal screen buffer, restore cursor"
++      write1("\033[?1049l");
+       //-----------------------------------------------------------
+       return 0;
+-- 
+1.7.11
+
index b5c9c45..3a98367 100644 (file)
@@ -27,6 +27,7 @@ hotfixes/busybox-1.20.1-ps.patch
 hotfixes/busybox-1.20.1-tar.patch
 
 #Patched pulled from busybox git
+patches-backports/0001-backport-vi-save-restore-screen-upon-invocation.patch
 
 #Miscellaneous