{"record":{"id":"4d1d0f6cd68000e1","repo":"charmbracelet/vhs","slug":"invalid-control-argument-literal","errorCode":null,"errorMessage":"Invalid control argument: ${literal}","messagePattern":"Invalid control argument: (.+?)","errorType":"validation","errorClass":"parser.Error","httpStatus":null,"severity":"error","filePath":"parser/parser.go","lineNumber":340,"sourceCode":"\t\t\tpeek.Type == token.SPACE,\n\t\t\tpeek.Type == token.BACKSPACE,\n\t\t\tpeek.Type == token.MINUS,\n\t\t\tpeek.Type == token.AT,\n\t\t\tpeek.Type == token.LEFT_BRACKET,\n\t\t\tpeek.Type == token.RIGHT_BRACKET,\n\t\t\tpeek.Type == token.CARET,\n\t\t\tpeek.Type == token.BACKSLASH,\n\t\t\tpeek.Type == token.LEFT,\n\t\t\tpeek.Type == token.RIGHT,\n\t\t\tpeek.Type == token.UP,\n\t\t\tpeek.Type == token.DOWN,\n\t\t\tpeek.Type == token.STRING && len(peek.Literal) == 1:\n\t\t\targs = append(args, peek.Literal)\n\t\tdefault:\n\t\t\t// Key arguments with len > 1 are not valid\n\t\t\tp.errors = append(p.errors,\n\t\t\t\tNewError(p.cur, \"Not a valid modifier\"),\n\t\t\t\tNewError(p.cur, \"Invalid control argument: \"+p.cur.Literal))\n\t\t}\n\n\t\tp.nextToken()\n\t}\n\n\tif len(args) == 0 {\n\t\tp.errors = append(p.errors, NewError(p.cur, \"Expected control character with args, got \"+p.cur.Literal))\n\t}\n\n\tctrlArgs := strings.Join(args, \" \")\n\treturn Command{Type: token.CTRL, Args: ctrlArgs}\n}\n\n// parseAlt parses an alt command.\n// An alt command takes a character to type while the modifier is held down.\n//\n//\tAlt+<character>\nfunc (p *Parser) parseAlt() Command {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/charmbracelet/vhs/blob/c073383b5de0b1f57bf514113029c306bc986539/parser/parser.go#L322-L358","documentation":"Emitted together with 'Not a valid modifier' whenever a Ctrl argument fails the accepted-key check (modifiers, known keyword keys, or single-character strings). It names the offending literal so the user can see exactly which argument was rejected.","triggerScenarios":"Same as error 6: a token in the Ctrl argument list that is not a modifier, not a known keyword key, and not a single-character string — 'Ctrl+foo', 'Ctrl+enter', 'Ctrl+Home' (if unsupported).","commonSituations":"Unsupported key names; case mismatches against token.Keywords; typos in single-character args.","solutions":["Replace the named invalid argument with a supported key or a single character.","Consult the vhs docs (Type/Ctrl reference) for the supported key list.","Lowercase/uppercase the key to match vhs's keyword spelling."],"exampleFix":"// before (.tape)\nCtrl+enter\n// after (.tape)\nCtrl+Enter","handlingStrategy":"validation","validationCode":"func validCtrlArg(a string) bool { if len(a) == 1 { return true }; _, ok := token.Keywords[a]; return ok }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy key names from the official vhs documentation rather than memory","Watch for both errors ('Not a valid modifier' + 'Invalid control argument') pointing at the same bad token","Test each Ctrl line incrementally when writing tapes"],"tags":["parser","ctrl-command","invalid-argument"],"backgroundTag":"invalid-key-combination","analyzedSha":"c073383b5de0b1f57bf514113029c306bc986539","analyzedAt":"2026-09-02T01:53:05.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}