shell

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bash = Shell{"\001", "\002"}
	Zsh  = Shell{"%{", "%}"}
)

Shell Definitions

Functions

func Set

func Set(name string)

Set changes the Shell by name with Bash as the fallback

Types

type Shell

type Shell struct {
	Start string
	End   string
}

Shell contains the shell-specific escape sequences for marking escape sequences in prompts

var Current Shell

Current is the most recently set Shell

func (Shell) First

func (s Shell) First(fg, bg color.Color) string

First color change

func (Shell) Full

func (s Shell) Full(ps []pieces.Piece) string

Full generates a string from each of the varous parts

func (Shell) Last

func (s Shell) Last(fg color.Color, carrot string) string

Last color change with carrot, reseting colors after

func (Shell) Prompt

func (s Shell) Prompt(statuses []string)

Prompt writes the configured Prompt to os.Stdout with the specified shell's formatting

func (Shell) Simple

func (s Shell) Simple(ps []pieces.Piece) string

Simple generates a string from each of the varous parts, for Linux console

func (Shell) Switch

func (s Shell) Switch(bg, nextBG, nextFG color.Color, carrot string) string

Switch the colors between pieces, making sure the carrot looks right

Jump to

Keyboard shortcuts

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