go-delve/delve · error

Backtick not supported in '%s'

Error message

Backtick not supported in '%s'

What it means

parseNewArgv parses the argument string for the `restart` command's new argv. It delegates tokenizing to the argv library, supplying a backtick-substitution callback that unconditionally fails: Delve's restart argv does not support backtick command substitution, so any backtick expression in the argument string produces this error naming the offending substring.

Source

Thrown at pkg/terminal/command.go:1276

func restartIntl(t *Term, rerecord bool, restartPos string, resetArgs bool, newArgv []string, newRedirects [3]string) error {
	discarded, err := t.client.RestartFrom(rerecord, restartPos, resetArgs, newArgv, newRedirects, false)
	if err != nil {
		return err
	}
	for i := range discarded {
		fmt.Fprintf(t.stdout, "Discarded %s at %s: %v\n", formatBreakpointName(discarded[i].Breakpoint, false), t.formatBreakpointLocation(discarded[i].Breakpoint), discarded[i].Reason)
	}
	return nil
}

func parseNewArgv(args string) (resetArgs bool, newArgv []string, newRedirects [3]string, err error) {
	if args == "" {
		return false, nil, [3]string{}, nil
	}
	v, err := argv.Argv(args,
		func(s string) (string, error) {
			return "", fmt.Errorf("Backtick not supported in '%s'", s)
		},
		nil)
	if err != nil {
		return false, nil, [3]string{}, err
	}
	if len(v) != 1 {
		return false, nil, [3]string{}, fmt.Errorf("illegal commandline '%s'", args)
	}
	w := v[0]
	if len(w) == 0 {
		return false, nil, [3]string{}, nil
	}
	if w[0] == "-noargs" {
		if len(w) > 1 {
			return false, nil, [3]string{}, errors.New("too many arguments to restart")
		}
		return true, nil, [3]string{}, nil
	}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Remove backticks and pass literal arguments: restart arg1 arg2.
  2. Compute the value externally (in the shell) and paste the result as a plain argument.
  3. Quote arguments with regular or single quotes instead of backticks.
  4. Use Delve's own substitution facilities where available instead of command substitution.

Example fix

# before
restart `date +%s`
# after
restart 1725120000   # value computed in the shell, passed literally
Defensive patterns

Strategy: validation

Validate before calling

if strings.ContainsRune(args, '`') {
    return fmt.Errorf("backtick substitution is not supported in restart arguments")
}

Type guard

func hasBacktickExpr(s string) bool { return strings.ContainsRune(s, '`') }

Try / catch

reset, argv, redirs, err := parseNewArgv(args)
if err != nil {
    if strings.HasPrefix(err.Error(), "Backtick not supported") {
        // sanitize input: strip backticks or compute value externally
    }
    return err
}

Prevention

When it happens

Trigger: Running `restart <args>` where <args> contains backtick-quoted command substitution, e.g. `restart -c `some command`` or any argument string with a ` character interpreted by the argv parser as a backtick expression.

Common situations: Users trying to embed dynamic values via shell-style command substitution in restart arguments; shell quoting habits (backticks) carried over from bash into the Delve CLI; stray backticks from copy-pasted commands.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/1864c3c6817413ef. Report an issue: GitHub.