We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70837bd commit 74a6437Copy full SHA for 74a6437
main.go
@@ -49,13 +49,19 @@ func main() {
49
clear()
50
t := time.NewTicker(time.Second)
51
defer t.Stop()
52
+ i := 0
53
for {
54
width, height, err := window.Size()
55
if err != nil {
56
log.Fatalf("Cannot get window size: %v", err)
57
}
58
select {
59
case <-t.C:
60
+ i++
61
+ if i%120 == 0 {
62
+ // Clear scrollback to avoid iTerm from eating all the memory.
63
+ cleanup()
64
+ }
65
render(dash, width, height-titleBarSize)
66
case <-exit:
67
@@ -87,3 +93,7 @@ func clear() {
87
93
func reset() {
88
94
print("\033\133\061\073\061\110") // move cursor to 0x0
89
95
96
+
97
+func cleanup() {
98
+ print("\033]1337;ClearScrollback\007")
99
+}
0 commit comments