Skip to content

Commit

Permalink
refactor(ansi): rename EraseDisplay constants to EraseScreen and add …
Browse files Browse the repository at this point in the history
…EraseEntireDisplay
  • Loading branch information
aymanbagabas committed Oct 24, 2024
1 parent afc68a9 commit ad25fd0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ansi/screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package ansi

import "strconv"

// EraseDisplay (ED) clears the screen or parts of the screen. Possible values:
// EraseDisplay (ED) clears the display or parts of the display. A screen is
// the shown part of the terminal display excluding the scrollback buffer.
// Possible values:
//
// 0: Clear from cursor to end of screen.
// 1: Clear from cursor to beginning of the screen.
// 2: Clear entire screen (and moves cursor to upper left on DOS).
// 3: Clear entire screen and delete all lines saved in the scrollback buffer.
// 3: Clear entire display which delete all lines saved in the scrollback buffer (xterm).
//
// CSI <n> J
//
Expand All @@ -22,9 +24,10 @@ func EraseDisplay(n int) string {
// EraseDisplay constants.
// These are the possible values for the EraseDisplay function.
const (
EraseDisplayBelow = "\x1b[0J"
EraseDisplayAbove = "\x1b[1J"
EraseEntireDisplay = "\x1b[2J"
EraseScreenBelow = "\x1b[0J"
EraseScreenAbove = "\x1b[1J"
EraseEntireScreen = "\x1b[2J"
EraseEntireDisplay = "\x1b[3J"
)

// EraseLine (EL) clears the current line or parts of the line. Possible values:
Expand Down

0 comments on commit ad25fd0

Please sign in to comment.