rawterm

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package rawterm provides some sort of raw terminal interface, both on hosted systems and baremetal. It is intended only for use by examples.

Newlines are always LF (not CR or CRLF). While terminals generally use a different format (CR when pressing the enter key and CRLF for newline) the format returned by Getchar and expected as input by Putchar is a single LF as newline symbol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure()

Configure initializes the terminal for use by raw reading/writing (using Getchar/Putchar). It must be restored after use with Restore. You can do this with the following code:

rawterm.Configure()
defer rawterm.Restore()
// use raw terminal features

func Getchar

func Getchar() byte

Getchar returns a single character from stdin, or a serial input. Newlines are encoded with a single LF ('\n').

func Putchar

func Putchar(ch byte)

Putchar writes a single character to the terminal. Newlines are expected to be encoded as LF symbols ('\n').

func Restore

func Restore()

Restore restores the state to before a call to Configure. It must be called after a call to Configure to restore the terminal state, and must only be called after a call to Configure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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