console

package
v0.0.0-...-b79a0d8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package console allows for some trivial manipulations of linux virtual terminals, such as switching which one is in the foreground, displaying messages, then switching back.

Makes use of the system's fgconsole, chvt, deallocvt tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreeVt

func FreeVt(id VTid) error

func MessageChannel

func MessageChannel() (vt vtChan, err error)

switch to an unused vt and display messages as they arrive in ch. destroy vt and switch back to original when ch is closed. NOTE - prog must not exit immediately after closing channel, or switch will not happen

func SetVt

func SetVt(id VTid) error

switch to given vt

func WriteVt

func WriteVt(id VTid, s string) error

write line to given vt

Types

type VTid

type VTid int64 //0 for unknown/error, -1 for serial

func CurrentVt

func CurrentVt() (id VTid, err error)

get current console id

func UnusedVt

func UnusedVt() (id VTid, err error)

get next unused console id

Directories

Path Synopsis
Test app for console package; normal unit test won't work as the vt commands require root privs.
Test app for console package; normal unit test won't work as the vt commands require root privs.

Jump to

Keyboard shortcuts

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