Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Fix PreviousLine and NextLine on linux #309

Merged
merged 1 commit into from
Dec 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions terminal/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ func (c *Cursor) Back(n int) {

// NextLine moves cursor to beginning of the line n lines down.
func (c *Cursor) NextLine(n int) {
fmt.Fprintf(c.Out, "\x1b[%dE", n)
c.Down(1)
}

// PreviousLine moves cursor to beginning of the line n lines up.
func (c *Cursor) PreviousLine(n int) {
fmt.Fprintf(c.Out, "\x1b[%dF", n)
c.Up(1)
}

// HorizontalAbsolute moves cursor horizontally to x.
Expand Down