summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorDenys Vlasenko2012-06-11 13:53:26 +0200
committerDenys Vlasenko2012-06-11 13:53:26 +0200
commitd3dff879f0683c2a4119f694c1b20c96ee030a26 (patch)
tree5c09c593a0c5ee214c78b36208c23d7a03750a68 /editors/vi.c
parent04b52892ed5d9d8a4cf5d887c221a8b50c71274e (diff)
downloadbusybox-d3dff879f0683c2a4119f694c1b20c96ee030a26.zip
busybox-d3dff879f0683c2a4119f694c1b20c96ee030a26.tar.gz
vi: save/restore screen upon invocation
function old new delta vi_main 253 273 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 459f374..e09e0d9 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -598,11 +598,15 @@ int vi_main(int argc, char **argv)
//----- This is the main file handling loop --------------
save_argc = argc;
optind = 0;
+ // "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;