Skip to content

Commit

Permalink
Fix nano scrolling (#80)
Browse files Browse the repository at this point in the history
* handle Reverse Index
* handle & parse ESC 7, ESC 8, fixups
  • Loading branch information
aaronjanse authored Aug 1, 2020
1 parent a6c09e9 commit 447aa2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ecma48/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ func (p *Parser) stateGround(r rune) {

func (p *Parser) stateEscape(r rune) {
switch {
case r == '7':
p.out <- p.wrap(SCOSC{})
p.state = stateGround
case r == '8':
p.out <- p.wrap(SCORC{})
p.state = stateGround
case strings.Contains("DEHMNOPVWXZ[\\]^_", string(r)):
p.anywhere(r + 0x40)
case 0x30 <= r && r <= 0x4F || 0x51 <= r && r <= 0x57:
Expand Down
6 changes: 6 additions & 0 deletions vterm/stdout.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ func (v *VTerm) ProcessStdout(input *bufio.Reader) {
} else {
v.shiftCursorY(1)
}
case ecma48.RI:
if v.Cursor.Y == v.scrollingRegion.top {
v.scrollDown(1)
} else {
v.shiftCursorY(-1)
}
case ecma48.CarriageReturn:
v.setCursorX(0)
case ecma48.Tab:
Expand Down

0 comments on commit 447aa2e

Please sign in to comment.