inoxsh_ns

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTRL_C_CODE = 3
	ENTER_CODE  = 13

	NoAction termAction = iota
	Up
	Down
	Right
	Left
	BackwardWord
	ForwardWord
	End
	Home
	Back
	DeleteWordBackward
	DeleteWordForward
	Enter
	Stop
	SuggestComplete
	Escape
	EscapeNext
	Delete
)
View Source
const (
	GLOBALS_KEY    = "globals"
	FG_COLOR_KEY   = "foreground-color"
	BG_COLOR_KEY   = "background-color"
	CONFIG_ARGNAME = "configuration"

	DEFAULT_IN_BUFFER_SIZE      = 1024
	DEFAULT_OUT_BUFFER_SIZE     = 4096
	DEFAULT_ERR_OUT_BUFFER_SIZE = 4096
)
View Source
const (
	DEFAULT_TERM_WIDTH      = 10
	DEFAULT_READ_CHUNK_SIZE = 1000

	CONFIRMATION_PROMPT_TIMEOUT   = 5 * time.Second
	MAX_CONFIRMATION_PROMPT_INPUT = 100
)

Variables

View Source
var (
	MOVE_CURSOR_NEXT_LINE_SEQ = utils.StringAsBytes(termenv.CSI + "1E")

	COLOR_NAME_TO_COLOR = map[core.Identifier]termenv.Color{
		"red":        termenv.ANSIRed,
		"bright-red": termenv.ANSIBrightRed,

		"blue":        termenv.ANSIBlue,
		"bright-blue": termenv.ANSIBrightBlue,

		"cyan":        termenv.ANSICyan,
		"bright-cyan": termenv.ANSIBrightCyan,

		"yellow":        termenv.ANSIYellow,
		"bright-yellow": termenv.ANSIBrightYellow,

		"green":        termenv.ANSIGreen,
		"bright-green": termenv.ANSIBrightGreen,

		"white":        termenv.ANSIWhite,
		"bright-white": termenv.ANSIBrightWhite,

		"black":        termenv.ANSIBlack,
		"bright-black": termenv.ANSIBrightBlack,

		"magenta":        termenv.ANSIMagenta,
		"bright-magenta": termenv.ANSIBrightMagenta,
	}
)
View Source
var (
	KEY_PRIORITY = map[string]int{
		"id":    -1000,
		"name":  -999,
		"title": -998,
	}

	ALLOWED_PROMPT_FUNCTION_NAMES = []string{"pwd", "whoami", "hostname"}
	SHELL_PROPNAMES               = []string{"write", "read", "start", "stop"}
)

Functions

func NewInoxshNamespace

func NewInoxshNamespace() *core.Namespace

func NewShell

func NewShell(ctx *core.Context, configObj *core.Object) (*shell, error)

func SetNewDefaultGlobalState

func SetNewDefaultGlobalState(fn func(ctx *core.Context, envPattern *core.ObjectPattern, out io.Writer) *core.GlobalState)

func StartShell

func StartShell(state *core.GlobalState, conf REPLConfiguration)

starts the shell, the execution of this function ends when the shell is exited.

Types

type PrintingConfig

type PrintingConfig struct {
	// contains filtered or unexported fields
}

func GetPrintingConfig

func GetPrintingConfig() PrintingConfig

func (PrintingConfig) Colorized

func (c PrintingConfig) Colorized() bool

func (PrintingConfig) IsLight

func (c PrintingConfig) IsLight() bool

func (PrintingConfig) PrettyPrintConfig

func (c PrintingConfig) PrettyPrintConfig() *core.PrettyPrintConfig

type REPLConfiguration

type REPLConfiguration struct {
	PrintingConfig
	// contains filtered or unexported fields
}

func MakeREPLConfiguration

func MakeREPLConfiguration(obj *core.Object) (REPLConfiguration, error)

MakeREPLConfiguration constructs a REPLConfiguration from an Object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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