shellconfig

package
v0.82.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package shellconfig resolves one immutable shell invocation policy for all coding-agent command execution paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLegacyWSLBashPath

func IsLegacyWSLBashPath(path string) bool

IsLegacyWSLBashPath identifies Windows' historical WSL bash launcher.

Types

type CommandTransport

type CommandTransport uint8

CommandTransport identifies where the shell receives command text.

const (
	CommandArgument CommandTransport = iota
	CommandStdin
)

type Config

type Config struct {
	Shell     string
	Args      []string
	Transport CommandTransport
}

Config is the resolved, reusable shell policy.

func ConfigForBash

func ConfigForBash(shell string) Config

ConfigForBash selects stdin transport for the legacy Windows WSL launcher.

func Resolve

func Resolve(
	customShellPath string,
	options ResolveOptions,
) (Config, error)

Resolve applies Pi's shell resolution order with Go-native path lookup.

func (Config) Invocation

func (c Config) Invocation(command string) Invocation

Invocation projects command text according to the resolved transport without sharing the Config Args backing array.

type Invocation

type Invocation struct {
	Command   string
	Args      []string
	Stdin     string
	UsesStdin bool
}

Invocation is a detached command-specific projection of Config.

type ResolveOptions

type ResolveOptions struct {
	GOOS       string
	Env        map[string]string
	FileExists func(string) bool
	LookPath   func(string) (string, error)
}

ResolveOptions supplies target-platform state and injectable filesystem boundaries. Zero values use the current process.

Jump to

Keyboard shortcuts

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