yorukot/superfile · error

could not execute shell substitution command : %s : %w

Error message

could not execute shell substitution command : %s : %w

What it means

Error "could not execute shell substitution command : %s : %w" thrown in yorukot/superfile.

Source

Thrown at src/internal/ui/prompt/tokenize.go:77

}

func updateResCommand(resCommand *strings.Builder, openChar rune, token string,
	subCmdTimeout time.Duration, cwdLocation string) error {
	switch openChar {
	case '{':
		value, ok := os.LookupEnv(token)
		if !ok {
			return envVarNotFoundError{varName: token}
		}
		// Might Handle values being too big, or having multiple lines
		// But this is based on user input, so it is probably okay for now
		// Same comment for command substitution
		resCommand.WriteString(value)
	case '(':
		retCode, output, err := utils.ExecuteCommandInShell(subCmdTimeout, cwdLocation, token)

		if retCode == -1 {
			return fmt.Errorf("could not execute shell substitution command : %s : %w", token, err)
		}
		// We are allowing commands that exit with non zero status code
		// We still use its output
		if retCode != 0 {
			slog.Debug("substitution command exited with non zero status", "retCode", retCode,
				"command", token)
		}
		resCommand.WriteString(output)
	default:
		return fmt.Errorf("unexpected openChar %v in tokenization", openChar)
	}
	return nil
}

func findEndingBracket(r []rune, openIdx int, openParan rune, closeParan rune) int {
	if openIdx < 0 || openIdx >= len(r) || r[openIdx] != openParan {
		return -1
	}

View on GitHub (pinned to b72f550bc6)

When it happens

Trigger: Thrown at src/internal/ui/prompt/tokenize.go:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of yorukot/superfile@b72f550bc6 (2026-09-01). Data as JSON: /api/errors/5008e8313ea15557. Report an issue: GitHub.