shell

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 47 Imported by: 0

Documentation

Overview

Package shell provides sources for the interactive shell

Index

Constants

View Source
const (
	// PromptSIGINT defines the string to write when ctrl+c is pressed
	PromptSIGINT = "^C"

	// PromptSIGQUIT defines the string to write when ctrl+\ is pressed
	PromptSIGQUIT = "^\\"

	// PromptEOF defines the string to write when ctrl+d is pressed
	PromptEOF = "^D"
)

Variables

View Source
var (
	// Prompt is the readline instance
	Prompt = readline.NewInstance()

	// Events is a callback for onPrompt events
	Events func(string, []rune)
)

Functions

func CommandLine

func CommandLine(ctx context.Context, block []rune, _ string, _ bool, size *readline.PreviewSizeT, callback readline.PreviewFuncCallbackT)

func ConfigReadGetCursorPos

func ConfigReadGetCursorPos() (interface{}, error)

ConfigReadGetCursorPos is a dynamic config wrapper function for Prompt.EnableGetCursorPos

func ConfigWriteGetCursorPos

func ConfigWriteGetCursorPos(v interface{}) error

ConfigWriteGetCursorPos is a dynamic config wrapper function for Prompt.EnableGetCursorPos

func DynamicPreview

func DynamicPreview(previewBlock string, exe string, params []string) readline.PreviewFuncT

func HintCodeBlock

func HintCodeBlock() []rune

func PreviewCommand

func PreviewCommand(ctx context.Context, _ []rune, command string, _ bool, size *readline.PreviewSizeT, callback readline.PreviewFuncCallbackT)

func PreviewFile

func PreviewFile(ctx context.Context, _ []rune, filename string, incImages bool, size *readline.PreviewSizeT, callback readline.PreviewFuncCallbackT)

func PreviewParameter

func PreviewParameter(ctx context.Context, block []rune, parameter string, incImages bool, size *readline.PreviewSizeT, callback readline.PreviewFuncCallbackT)

func SignalHandler

func SignalHandler(interactive bool)

SignalHandler is an internal function to capture and handle OS signals (eg SIGTERM).

func Spellchecker

func Spellchecker(r []rune) []rune

func Start

func Start()

Start the interactive shell

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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