{"record":{"id":"1864c3c6817413ef","repo":"go-delve/delve","slug":"backtick-not-supported-in-s","errorCode":null,"errorMessage":"Backtick not supported in '%s'","messagePattern":"Backtick not supported in '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/command.go","lineNumber":1276,"sourceCode":"\nfunc restartIntl(t *Term, rerecord bool, restartPos string, resetArgs bool, newArgv []string, newRedirects [3]string) error {\n\tdiscarded, err := t.client.RestartFrom(rerecord, restartPos, resetArgs, newArgv, newRedirects, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor i := range discarded {\n\t\tfmt.Fprintf(t.stdout, \"Discarded %s at %s: %v\\n\", formatBreakpointName(discarded[i].Breakpoint, false), t.formatBreakpointLocation(discarded[i].Breakpoint), discarded[i].Reason)\n\t}\n\treturn nil\n}\n\nfunc parseNewArgv(args string) (resetArgs bool, newArgv []string, newRedirects [3]string, err error) {\n\tif args == \"\" {\n\t\treturn false, nil, [3]string{}, nil\n\t}\n\tv, err := argv.Argv(args,\n\t\tfunc(s string) (string, error) {\n\t\t\treturn \"\", fmt.Errorf(\"Backtick not supported in '%s'\", s)\n\t\t},\n\t\tnil)\n\tif err != nil {\n\t\treturn false, nil, [3]string{}, err\n\t}\n\tif len(v) != 1 {\n\t\treturn false, nil, [3]string{}, fmt.Errorf(\"illegal commandline '%s'\", args)\n\t}\n\tw := v[0]\n\tif len(w) == 0 {\n\t\treturn false, nil, [3]string{}, nil\n\t}\n\tif w[0] == \"-noargs\" {\n\t\tif len(w) > 1 {\n\t\t\treturn false, nil, [3]string{}, errors.New(\"too many arguments to restart\")\n\t\t}\n\t\treturn true, nil, [3]string{}, nil\n\t}","sourceCodeStart":1258,"sourceCodeEnd":1294,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/command.go#L1258-L1294","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove backticks and pass literal arguments: restart arg1 arg2.","Compute the value externally (in the shell) and paste the result as a plain argument.","Quote arguments with regular or single quotes instead of backticks.","Use Delve's own substitution facilities where available instead of command substitution."],"exampleFix":"# before\nrestart `date +%s`\n# after\nrestart 1725120000   # value computed in the shell, passed literally","handlingStrategy":"validation","validationCode":"if strings.ContainsRune(args, '`') {\n    return fmt.Errorf(\"backtick substitution is not supported in restart arguments\")\n}","typeGuard":"func hasBacktickExpr(s string) bool { return strings.ContainsRune(s, '`') }","tryCatchPattern":"reset, argv, redirs, err := parseNewArgv(args)\nif err != nil {\n    if strings.HasPrefix(err.Error(), \"Backtick not supported\") {\n        // sanitize input: strip backticks or compute value externally\n    }\n    return err\n}","preventionTips":["Never use backticks in Delve CLI argument strings — use plain or quoted literals.","Compute dynamic values in your shell before invoking dlv.","Sanitize copy-pasted shell commands of backticks before running them in the terminal.","Prefer single/double quoting for arguments containing spaces."],"tags":["terminal","cli","argv-parsing","command-substitution"],"backgroundTag":"unsupported-backtick-substitution","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}