shell

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: BSD-2-Clause Imports: 39 Imported by: 0

Documentation

Overview

Package shell is the entry point for the terminal interface of Elvish.

Index

Constants

This section is empty.

Variables

View Source
var Program prog.Program = program{}

Program is the shell subprogram.

Functions

func CleanupRuntime

func CleanupRuntime(stderr io.Writer, ev *eval.Evaler)

CleanupRuntime cleans up the runtime.

func InitRuntime

func InitRuntime(stderr io.Writer, p Paths, spawn bool) *eval.Evaler

InitRuntime initializes the runtime. The caller should call CleanupRuntime when the Evaler is no longer needed.

func Interact

func Interact(fds [3]*os.File, cfg *InteractConfig)

Interact runs an interactive shell session.

func Script

func Script(fds [3]*os.File, args []string, cfg *ScriptConfig) int

Script executes a shell script.

Types

type InteractConfig

type InteractConfig struct {
	SpawnDaemon bool
	Paths       Paths
}

InteractConfig keeps configuration for the interactive mode.

type Paths

type Paths struct {
	RunDir string
	Sock   string

	DataDir string
	Db      string
	Rc      string
	LibDir  string

	Bin string
}

Paths keeps all paths required for the Elvish runtime.

func MakePaths

func MakePaths(stderr io.Writer, overrides Paths) Paths

MakePaths makes a populated Paths, using the given overrides.

type ScriptConfig

type ScriptConfig struct {
	SpawnDaemon bool
	Paths       Paths

	Cmd         bool
	CompileOnly bool
	JSON        bool
}

ScriptConfig keeps configuration for the script mode.

Jump to

Keyboard shortcuts

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