shell

package
v0.0.0-...-2bc12df Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shell

type Shell interface {
	// Command constructs the command to invoke the shell. Subcommands should be made available in the
	// shell environment as `env WASH_EMBEDDED=1 wash <subcommand>`. Rundir is a temporary directory
	// that will be added to `PATH` when the command is invoked; you can use it to add new executables
	// or store other temporary files. A `W` environment will also be set to the path where the shell
	// starts.
	//
	// Implementations should support their native interactive and non-interactive config, as well as
	// Wash's (.washrc and .washenv, respectively). They should:
	//   1. if ~/.washenv does not exist, load the shell's default non-interactive config
	//   1. configure subcommand aliases
	//   1. if ~/.washenv exists, load it
	// Additionally for interactive invocations they should:
	//   1. if ~/.washrc does not exist, load the shell's default interactive config
	//   1. reconfigure subcommand aliases (in case they were overridden)
	//   1. configure the prompt to show your location within the Wash hierarchy (use preparePrompt)
	//   1. override cd so `cd` without arguments changes directory to $W (use overrideCd)
	//   1. if ~/.washrc exists, load it
	Command(subcommands []string, rundir string) (*exec.Cmd, error)
}

Shell provides setup for a specific shell, such as bash or zsh.

func Get

func Get() Shell

Get returns an implementation for the shell described by the SHELL environment variable.

Jump to

Keyboard shortcuts

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