terminal

package module
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Terminal

Terminal is a simple golang package that provides basic terminal handling.

Terminal wraps color/format functions provided by ANSI escape code

Usage

package main

import (
  "github.com/kiyor/terminal"
  "github.com/kiyor/terminal/color"
)

func main() {
  terminal.Stdout.Color("y").
    Print("Hello world").Nl().
    Reset().
    Colorf("@{kW}Hello world\n")

  color.Print("@rHello world")
  color.Print("@{216 8}Hello world")
}

Check the godoc result for more details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdout = &TerminalWriter{os.Stdout}
	Stderr = &TerminalWriter{os.Stderr}
)

Functions

This section is empty.

Types

type TerminalWriter

type TerminalWriter struct {
	io.Writer
}

func (*TerminalWriter) Clear

func (w *TerminalWriter) Clear() *TerminalWriter

func (*TerminalWriter) ClearLine

func (w *TerminalWriter) ClearLine() *TerminalWriter

func (*TerminalWriter) Color

func (w *TerminalWriter) Color(syntax string) *TerminalWriter

func (*TerminalWriter) Colorf

func (w *TerminalWriter) Colorf(format string, a ...interface{}) *TerminalWriter

func (*TerminalWriter) Down

func (w *TerminalWriter) Down(x int) *TerminalWriter

func (*TerminalWriter) Left

func (w *TerminalWriter) Left(x int) *TerminalWriter

func (*TerminalWriter) Move

func (w *TerminalWriter) Move(x, y int) *TerminalWriter

func (*TerminalWriter) Nl

func (w *TerminalWriter) Nl(a ...interface{}) *TerminalWriter

func (*TerminalWriter) Print

func (w *TerminalWriter) Print(a ...interface{}) *TerminalWriter

func (*TerminalWriter) Reset

func (w *TerminalWriter) Reset() *TerminalWriter

func (*TerminalWriter) Right

func (w *TerminalWriter) Right(x int) *TerminalWriter

func (*TerminalWriter) Up

func (w *TerminalWriter) Up(x int) *TerminalWriter

Source Files

Directories

Path Synopsis
The colors package provide a simple way to bring colorful charcaters to terminal interface.
The colors package provide a simple way to bring colorful charcaters to terminal interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL