goscreen

package module
v0.0.0-...-7d61629 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 3 Imported by: 0

README

GoScreen package provides an easy way for clearing the screen and getting the size of the current terminal.

Installation:

$ go get -u github.com/arifamir/goscreen

Clearing the Screen:

You can clear the screen and move the cursor to the top-left corner of the screen. This is good enough to create an animated program (such as an always updating clock or a progress bar).

package main

import (
"fmt"
"time"
"github.com/arifamir/goscreen"
)

func main() {

    goscreen.Clear()

    for {
        // Moves the cursor to the top-left position of the screen
        goscreen.MoveTopLeft()

        // Animate the time always in the same position
        fmt.Println(time.Now())

        time.Sleep(time.Second)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

Clear clears the screen

func MoveTopLeft

func MoveTopLeft()

MoveTopLeft moves the cursor to the top left position of the screen

func Size

func Size() (int, int)

Size returns the width and height of the terminal screen

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL