shell

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACK           = 6
	TAB           = 9
	LF            = 10
	CR            = 13
	US            = 31
	SPACE         = 32
	AMPERSTAND    = 38
	SINGLE_QUOTE  = 39
	PLUS          = 43
	NINE          = 57
	QUESTION      = 63
	UPPERCASE_Z   = 90
	OPEN_BRACKET  = 91
	BACKSLASH     = 92
	UNDERSCORE    = 95
	CLOSE_BRACKET = 93
	BACKTICK      = 96
	LOWERCASE_Z   = 122
	TILDA         = 126
	DEL           = 127
)

nolint

Variables

View Source
var Bash = bash{}
View Source
var Clink = clink{}
View Source
var Zsh = zsh{}

Functions

func BashEscape

func BashEscape(str string) string

https://github.com/solidsnack/shell-escape/blob/master/Text/ShellEscape/Bash.hs

A Bash escaped string. The strings are wrapped in @$\'...\'@ if any bytes within them must be escaped; otherwise, they are left as is. Newlines and other control characters are represented as ANSI escape sequences. High bytes are represented as hex codes. Thus Bash escaped strings will always fit on one line and never contain non-ASCII bytes.

func PowerShellEscape

func PowerShellEscape(str string) string

Types

type Process

type Process interface {
	Open(pid int) error
}

func GetProcess

func GetProcess() Process

type Shell

type Shell interface {
	Activate() (string, error)
	Export(envs env.Vars) string
}
var Fish Shell = fish{}

Fish adds support for the fish shell as a host

var Pwsh Shell = pwsh{}

Pwsh shell instance

func NewShell

func NewShell(name string) Shell

Jump to

Keyboard shortcuts

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