From dc55e68524a84544417c1ce290df447c4f0b1d60 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Aug 2017 01:58:09 +0900 Subject: [PATCH] Remove unnecessary SCP (Save Cursor Position) It is reported that it can have an unwanted side effect of clearing the screen on terminal emulators that do not properly support it. Patch suggested by @arya. Close #1011 --- src/tui/light.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tui/light.go b/src/tui/light.go index f9059180..15f4e012 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -209,7 +209,9 @@ func (r *LightRenderer) Init() { r.csi(fmt.Sprintf("%dA", r.MaxY()-1)) r.csi("G") r.csi("K") - r.csi("s") + if !r.clearOnExit && !r.fullscreen { + r.csi("s") + } if !r.fullscreen && r.mouse { r.yoffset, _ = r.findOffset() }