Closed rrrooommmaaa closed 5 years ago
Thanks for working on this. There seems to be a bug here. I tried out this PR and saw this panic just after starting htop
:
$ ./aminal
1.5495340851104596e+09 info aminal/main.go:30 Allocating pty...
1.5495340851117826e+09 info aminal/main.go:56 Creating terminal...
1.5495340852951438e+09 info gui/gui.go:685 OpenGL version 4.5 (Core Profile) Mesa 18.2.2
1.5495340878538976e+09 error terminal/output.go:117 Error handling escape sequence: Window manipulation is not yet supported
github.com/liamg/aminal/terminal.(*Terminal).processInput
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/output.go:117
1.5495340878542192e+09 info terminal/modes.go:86 Turning on VT200 mouse mode
panic: runtime error: index out of range
goroutine 8 [running]:
github.com/liamg/aminal/buffer.(*Buffer).AreaScrollDown(0xc000138090, 0xb)
/tmp/.gobuild/src/github.com/liamg/aminal/buffer/buffer.go:357 +0x1b1
github.com/liamg/aminal/terminal.(*Terminal).AreaScrollDown(0xc00013a0e0, 0x87000b)
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/terminal.go:185 +0x39
github.com/liamg/aminal/terminal.csiScrollDownHandler(0xc0012480e0, 0x1, 0x1, 0xc00013a0e0, 0x1, 0x0)
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/csi.go:373 +0xcc
github.com/liamg/aminal/terminal.csiHandler(0xc000ace000, 0xc00013a0e0, 0x5b, 0xc00013e178)
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/csi.go:105 +0x382
github.com/liamg/aminal/terminal.ansiHandler(0xc000ace000, 0xc00013a0e0, 0x0, 0x0)
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/ansi.go:69 +0x9c
github.com/liamg/aminal/terminal.(*Terminal).processInput(0xc00013a0e0, 0xc000ace000)
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/output.go:116 +0x7d
created by github.com/liamg/aminal/terminal.(*Terminal).Read
/tmp/.gobuild/src/github.com/liamg/aminal/terminal/terminal.go:320 +0x110
It's not all that easy to repro though. In case it's relevant, the aminal window was fairly narrow - about 1/3 of the monitor.
When there's no panic, the htop display glitches do seem to be fixed though. Thanks very much.
@mjs The latest fix should settle the downscroll bug.
Description
Implemented scrolling of a group of lines within set margins Fixes # 183
Type of change
How Has This Been Tested?
snap
oraminal
).Test Configuration: