MCPcopy Create free account
hub / github.com/cogentcore/core / NewShell

Function NewShell

shell/shell.go:111–125  ·  view source on GitHub ↗

NewShell returns a new [Shell] with default options.

()

Source from the content-addressed store, hash-verified

109
110// NewShell returns a new [Shell] with default options.
111func NewShell() *Shell {
112 sh := &Shell{
113 Config: exec.Config{
114 Dir: errors.Log1(os.Getwd()),
115 Env: map[string]string{},
116 Buffer: false,
117 },
118 }
119 sh.Config.StdIO.SetFromOS()
120 sh.SSH = sshclient.NewConfig(&sh.Config)
121 sh.SSHClients = make(map[string]*sshclient.Client)
122 sh.Commands = make(map[string]func(args ...string))
123 sh.InstallBuiltins()
124 return sh
125}
126
127// StartContext starts a processing context,
128// setting the Ctx and Cancel Fields.

Callers 6

NewInterpreterFunction · 0.92
BuildFunction · 0.92
TestExecFunction · 0.85
TestPathsFunction · 0.85
TestTranspileFunction · 0.85
TestCommandFunction · 0.85

Calls 4

InstallBuiltinsMethod · 0.95
Log1Function · 0.92
NewConfigFunction · 0.92
SetFromOSMethod · 0.80

Tested by 4

TestExecFunction · 0.68
TestPathsFunction · 0.68
TestTranspileFunction · 0.68
TestCommandFunction · 0.68