Skip to content

Commit

Permalink
feat(ansi): add HomeCursorPosition constant
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Nov 4, 2024
1 parent 3df16cb commit 354bfee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ansi/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ func SetCursorPosition(col, row int) string {
return "\x1b[" + strconv.Itoa(row) + ";" + strconv.Itoa(col) + "H"
}

// HomeCursorPosition is a sequence for moving the cursor to the upper left
// corner of the scrolling region. This is equivalent to `SetCursorPosition(1, 1)`.
const HomeCursorPosition = "\x1b[H"

// MoveCursor (CUP) returns a sequence for setting the cursor to the
// given row and column.
//
Expand Down

0 comments on commit 354bfee

Please sign in to comment.