|
@@ -32,7 +32,14 @@ func (bar *ScreenBar) reset(msg *osc.Message) {
|
|
bar.update()
|
|
bar.update()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// Paint a screen by drawing bar
|
|
func (bar *ScreenBar) update() {
|
|
func (bar *ScreenBar) update() {
|
|
|
|
+ // Config size if in terminal
|
|
|
|
+ if term.IsTerminal(0) {
|
|
|
|
+ bar.columns, _, _ = term.GetSize(0)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Go home and draw (type) a bar
|
|
fmt.Print("[H[2J[3J")
|
|
fmt.Print("[H[2J[3J")
|
|
fmt.Print("[0;37;40m")
|
|
fmt.Print("[0;37;40m")
|
|
s := fmt.Sprintf(" %%%ds %%6d ", 9-bar.columns)
|
|
s := fmt.Sprintf(" %%%ds %%6d ", 9-bar.columns)
|