prepare busybox-power 1.20.2power5 release
[busybox-power] / debian / patches / patches-backports / 0001-backport-vi-save-restore-screen-upon-invocation.patch
1 From 5b7472b9b70a16201bcaa4cb69c617c19b889b77 Mon Sep 17 00:00:00 2001
2 From: Dennis Groenen <tj.groenen@gmail.com>
3 Date: Fri, 22 Jun 2012 21:49:21 +0200
4 Subject: [PATCH] backport: vi: save/restore screen upon invocation
5
6 Backport of git commit d3dff879f0683c2a4119f694c1b20c96ee030a26
7 ---
8  editors/vi.c | 4 ++++
9  1 file changed, 4 insertions(+)
10
11 diff --git a/editors/vi.c b/editors/vi.c
12 index b4ad12e..8aea2e2 100644
13 --- a/editors/vi.c
14 +++ b/editors/vi.c
15 @@ -603,11 +603,15 @@ int vi_main(int argc, char **argv)
16         optind = 0;
17  
18         //----- This is the main file handling loop --------------
19 +       // "Save cursor, use alternate screen buffer, clear screen"
20 +       write1("\033[?1049h");
21         while (1) {
22                 edit_file(argv[optind]); /* param might be NULL */
23                 if (++optind >= argc)
24                         break;
25         }
26 +       // "Use normal screen buffer, restore cursor"
27 +       write1("\033[?1049l");
28         //-----------------------------------------------------------
29  
30         return 0;
31 -- 
32 1.7.11
33