aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-09-20 15:00:22 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-12-11 19:03:32 +0200
commit54b21035d1f5413ef6ed231bbc5a3a34ca20db33 (patch)
treee53f8b8dd2acd06700e77ec38c72c35cd435bd26
parent3894ca654b2ffbae6d3a977b9596c15e301e20cf (diff)
downloadbuild_soong-54b21035d1f5413ef6ed231bbc5a3a34ca20db33.tar.gz
build_soong-54b21035d1f5413ef6ed231bbc5a3a34ca20db33.tar.bz2
build_soong-54b21035d1f5413ef6ed231bbc5a3a34ca20db33.zip
status table: ANSI code rows and columns are 1-based
Don't pass 0 to setCursor or setScrollingMargins. Passing 0 hasn't caused any known issues, but 1 is correct. Test: m nothing Change-Id: I8735032eb3f1d46df4c41c4ea9ef95b5fd842824
-rw-r--r--ui/terminal/smart_status.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/terminal/smart_status.go b/ui/terminal/smart_status.go
index 57f71ab8..aa7e50a4 100644
--- a/ui/terminal/smart_status.go
+++ b/ui/terminal/smart_status.go
@@ -189,7 +189,7 @@ func (s *smartStatusOutput) Flush() {
fmt.Fprintf(s.writer, ansi.resetScrollingMargins())
_, height, _ := termSize(s.writer)
// Move the cursor to the top of the now-blank, previously non-scrolling region
- fmt.Fprintf(s.writer, ansi.setCursor(height-s.tableHeight, 0))
+ fmt.Fprintf(s.writer, ansi.setCursor(height-s.tableHeight, 1))
// Turn the cursor back on
fmt.Fprintf(s.writer, ansi.showCursor())
}
@@ -334,9 +334,9 @@ func (s *smartStatusOutput) actionTable() {
scrollingHeight := s.termHeight - s.tableHeight
// Update the scrolling region in case the height of the terminal changed
- fmt.Fprint(s.writer, ansi.setScrollingMargins(0, scrollingHeight))
+ fmt.Fprint(s.writer, ansi.setScrollingMargins(1, scrollingHeight))
// Move the cursor to the first line of the non-scrolling region
- fmt.Fprint(s.writer, ansi.setCursor(scrollingHeight+1, 0))
+ fmt.Fprint(s.writer, ansi.setCursor(scrollingHeight+1, 1))
// Write as many status lines as fit in the table
var tableLine int
@@ -379,7 +379,7 @@ func (s *smartStatusOutput) actionTable() {
}
// Move the cursor back to the last line of the scrolling region
- fmt.Fprint(s.writer, ansi.setCursor(scrollingHeight, 0))
+ fmt.Fprint(s.writer, ansi.setCursor(scrollingHeight, 1))
}
var ansi = ansiImpl{}