Discover Packages
github.com/benizi/termstate
package
module
Version:
v0.0.0-...-57f4ce7
Opens a new window with list of versions in this module.
Published: Sep 29, 2016
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 3 modules, 2 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
termstate
Simple terminal state settings.
Description
This is a simple lib to set/reset cbreak and echo modes in Go.
Expand ▾
Collapse ▴
Documentation
¶
Rendered for
linux/amd64
windows/amd64
darwin/amd64
js/wasm
func DeferredReset(modifiers ...modifier) func()
DeferredReset is a convenience function for setting modes on the current
state, then resetting them later.
Example usage:
defer termstate.DeferredReset(
termstate.State.Cbreak,
termstate.State.EchoOff,
)()
IsSupported indicates whether termstate is supported on this platform.
State holds information about a terminal.
Get fetches the current terminal state for stdin.
GetFD fetches the current terminal state for the given file descriptor.
Cbreak adds `cbreak` (also called `rare`) mode to the state.
Echo sets the `ECHO` and `ECHONL` properties.
EchoOff is for use in `DeferredReset` (equivalent to `Echo(false)`).
EchoOn is for use in `DeferredReset` (equivalent to `Echo(true)`).
Set attempts to set the terminal state for stdin.
SetFD attempts to set the terminal to this `State`, returning the original
state and or an error.
Source Files
¶
Directories
¶
examples
Click to show internal directories.
Click to hide internal directories.