From 3d1a217cab086267b6c48f7d48447da3c7db12d2 Mon Sep 17 00:00:00 2001 From: SystemGlitch Date: Fri, 6 Nov 2020 09:56:29 +0100 Subject: [PATCH] Fix PreviousLine and NextLine on linux --- terminal/cursor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal/cursor.go b/terminal/cursor.go index c5b68414..c294ca4c 100644 --- a/terminal/cursor.go +++ b/terminal/cursor.go @@ -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.